Commit 99d0306c authored by Jan Kadlec's avatar Jan Kadlec

Minor formatting fixes in src/server.

Closes #145
parent 53af96a9
/*!
* \file dthreads.h
*
* \author Marek Vavrusa <marek.vavusa@nic.cz>
*
* \brief Threading API.
......
......@@ -364,7 +364,7 @@ static void ns_put_additional(const zn_node_t *node, ldns_pkt *response,
name = ldns_rr_ns_nsdname(rr);
break;
case LDNS_RR_TYPE_SRV:
name = ldns_rr_rdf(rr, 3); // get rid of the number
name = ldns_rr_rdf(rr, 3); // get rid of the number
if (ldns_dname_label_count(name) == 0) {
continue;
}
......@@ -392,8 +392,8 @@ static void ns_put_additional(const zn_node_t *node, ldns_pkt *response,
LDNS_SECTION_ADDITIONAL, 0, response,
copied_rrs);
ns_put_rrset(rrsets->aaaa, name,
LDNS_SECTION_ADDITIONAL, 0,
response, copied_rrs);
LDNS_SECTION_ADDITIONAL, 0, response,
copied_rrs);
} else {
debug_ns("No referenced RRSets!\n");
}
......@@ -510,9 +510,9 @@ static inline void ns_referral(const zn_node_t *node, ldns_pkt *response,
static int ns_additional_needed(ldns_rr_type qtype)
{
return (qtype == LDNS_RR_TYPE_MX
|| qtype == LDNS_RR_TYPE_NS
|| qtype == LDNS_RR_TYPE_SRV);
return (qtype == LDNS_RR_TYPE_MX ||
qtype == LDNS_RR_TYPE_NS ||
qtype == LDNS_RR_TYPE_SRV);
}
/*----------------------------------------------------------------------------*/
......@@ -622,8 +622,8 @@ static void ns_process_dname(ldns_rr_list *dname_rrset, const ldns_rdf *qname,
/*----------------------------------------------------------------------------*/
static const zn_node_t *ns_strip_and_find(const zdb_zone_t *zone, ldns_rdf **qname,
uint *labels)
static const zn_node_t *ns_strip_and_find(const zdb_zone_t *zone,
ldns_rdf **qname, uint *labels)
{
const zn_node_t *node = NULL;
// search for the name and strip labels until nothing left
......
/*!
* \file server.h
*
* \author Lubos Slovak <lubos.slovak@nic.cz>
*
* \brief Core server functions.
......
/*!
* \file socket.h
*
* \author Marek Vavrusa <marek.vavusa@nic.cz>
*
* \brief Generic sockets APIs.
......@@ -13,11 +14,12 @@
#ifndef _CUTEDNS_SOCKET_H_
#define _CUTEDNS_SOCKET_H_
#include "common.h"
/* POSIX only. */
#include <sys/socket.h>
#include "common.h"
/*! \brief Socket-related constants. */
enum {
SOCKET_MTU_SZ = 8192, /*!< \todo Determine UDP MTU size. */
......@@ -99,12 +101,12 @@ ssize_t socket_recvfrom(int socket, void *buf, size_t len, int flags,
struct sockaddr *from, socklen_t *fromlen);
/*!
* \brief Send data to connection-mode socket.
* \brief Send data to connection-mode socket.
*
* \param socket Socket filedescriptor.
* \param buf Source buffer.
* \param len Data length.
* \param flags Additional flags.
* \param socket Socket filedescriptor.
* \param buf Source buffer.
* \param len Data length.
* \param flags Additional flags.
*
* \retval 0 On success.
* \retval <0 If an error occured.
......@@ -112,14 +114,14 @@ ssize_t socket_recvfrom(int socket, void *buf, size_t len, int flags,
ssize_t socket_send(int socket, const void *buf, size_t len, int flags);
/*!
* \brief Send data to datagram-mode socket.
* \brief Send data to datagram-mode socket.
*
* \param socket Socket filedescriptor.
* \param buf Source buffer.
* \param len Data length.
* \param flags Additional flags.
* \param to Datagram source address.
* \param tolen Address length.
* \param socket Socket filedescriptor.
* \param buf Source buffer.
* \param len Data length.
* \param flags Additional flags.
* \param to Datagram source address.
* \param tolen Address length.
*
* \retval 0 On success.
* \retval <0 If an error occured.
......@@ -128,9 +130,9 @@ ssize_t socket_sendto(int socket, const void *buf, size_t len, int flags,
const struct sockaddr *to, socklen_t tolen);
/*!
* \brief Close and deinitialize socket.
* \brief Close and deinitialize socket.
*
* \param socket Socket filedescriptor.
* \param socket Socket filedescriptor.
*
* \retval 0 On success.
* \retval <0 If an error occured.
......
......@@ -87,7 +87,8 @@ int tcp_master(dthread_t *thread)
// Allocate new pool if needed
if (t->run != &tcp_pool) {
dt_repurpose(t, &tcp_pool, tcp_pool_new(handler));
debug_dt("dthreads: [%p] repurposed as TCP pool\n", t);
debug_dt("dthreads: [%p] repurposed "
"as TCP pool\n", t);
}
// Add incoming socket to selected pool
......
/*!
* \file tcp-handler.h
*
* \author Marek Vavrusa <marek.vavusa@nic.cz>
*
* \brief TCP sockets threading model.
......
/*!
* \file udp-handler.h
*
* \author Marek Vavrusa <marek.vavusa@nic.cz>
*
* \brief UDP sockets threading model.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment