43 static const char* dnsh_str =
"dnshandler";
45 static void dnshandler_handle_xfr(
netio_type* netio,
56 if (!allocator || !interfaces || interfaces->
count <= 0) {
63 "allocator_alloc() failed", dnsh_str);
78 "allocator_alloc() failed", dnsh_str);
85 "netio_create() failed", dnsh_str);
92 "query_create() failed", dnsh_str);
169 ods_log_debug(
"[%s] add udp network handler fd %u", dnsh_str,
170 (
unsigned) handler->
fd);
193 handler = &tcp_accept_handlers[i];
199 ods_log_debug(
"[%s] add tcp network handler fd %u", dnsh_str,
200 (
unsigned) handler->
fd);
207 if (errno != EINTR) {
237 if (dnshandler && dnshandler->
thread_id) {
238 ods_thread_kill(dnshandler->
thread_id, SIGHUP);
254 nb = send(dnshandler->
xfrhandler.
fd, (
const void*) pkt, len, 0);
256 ods_log_error(
"[%s] unable to forward notify: send() failed (%s)",
257 dnsh_str, strerror(errno));
259 ods_log_debug(
"[%s] forwarded notify: %u bytes sent", dnsh_str, nb);
270 dnshandler_handle_xfr(
netio_type* ATTR_UNUSED(netio),
275 ssize_t received = 0;
283 if (received == -1) {
284 ods_log_debug(
"[%s] unable to forward xfr packet: %s", dnsh_str,