41 static const char* dnsh_str =
"dnshandler";
43 static void dnshandler_handle_xfr(
netio_type* netio,
54 if (!allocator || !interfaces || interfaces->
count <= 0) {
61 "allocator_alloc() failed", dnsh_str);
76 "allocator_alloc() failed", dnsh_str);
83 "netio_create() failed", dnsh_str);
90 "query_create() failed", dnsh_str);
167 ods_log_debug(
"[%s] add udp network handler fd %u", dnsh_str,
168 (
unsigned) handler->
fd);
191 handler = &tcp_accept_handlers[i];
197 ods_log_debug(
"[%s] add tcp network handler fd %u", dnsh_str,
198 (
unsigned) handler->
fd);
205 if (errno != EINTR) {
235 if (dnshandler && dnshandler->
thread_id) {
236 ods_thread_kill(dnshandler->
thread_id, SIGHUP);
252 nb = send(dnshandler->
xfrhandler.
fd, (
const void*) pkt, len, 0);
254 ods_log_error(
"[%s] unable to forward notify: send() failed (%s)",
255 dnsh_str, strerror(errno));
257 ods_log_debug(
"[%s] forwarded notify: %u bytes sent", dnsh_str, nb);
268 dnshandler_handle_xfr(
netio_type* ATTR_UNUSED(netio),
273 ssize_t received = 0;
281 if (received == -1) {
282 ods_log_debug(
"[%s] unable to forward xfr packet: %s", dnsh_str,