]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix that ub_event has the facility to deal with callbacks for
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 2 Apr 2025 14:25:58 +0000 (16:25 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Wed, 2 Apr 2025 14:25:58 +0000 (16:25 +0200)
  fast reload, doq, windows-stop and dnstap.
- Fix fast reload test to check if pid exists before acting on it.

Makefile.in
doc/Changelog
testdata/fast_reload_fwd.tdir/fast_reload_fwd.post
util/ub_event.c

index 0cdff8ac15756401fb2fdd072d13c5a7e1919c07..463cdac286e14a5dfdc8bb9dc2c33161de1511cc 100644 (file)
@@ -1064,7 +1064,7 @@ tube.lo tube.o: $(srcdir)/util/tube.c config.h $(srcdir)/util/tube.h $(srcdir)/u
  $(srcdir)/libunbound/unbound.h $(srcdir)/respip/respip.h $(srcdir)/util/ub_event.h
 ub_event.lo ub_event.o: $(srcdir)/util/ub_event.c config.h $(srcdir)/util/ub_event.h $(srcdir)/util/log.h \
  $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h  \
- $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h
+ $(srcdir)/util/tube.h $(srcdir)/util/mini_event.h $(srcdir)/util/rbtree.h $(srcdir)/daemon/remote.h
 ub_event_pluggable.lo ub_event_pluggable.o: $(srcdir)/util/ub_event_pluggable.c config.h $(srcdir)/util/ub_event.h \
  $(srcdir)/libunbound/unbound-event.h $(srcdir)/util/netevent.h $(srcdir)/dnscrypt/dnscrypt.h \
   $(srcdir)/util/log.h $(srcdir)/util/fptr_wlist.h \
index fff1cc51d38ad03951f5272579728b51ea9c359c..167a2ce42500e3990c43b441afa703a5c11182b3 100644 (file)
@@ -7,6 +7,9 @@
        - Fix unbound-control test so it counts the new flush_negative output,
          also answers the _ta probe from testns and prints command output
          and skip a thread specific test when no threads are available.
+       - Fix that ub_event has the facility to deal with callbacks for
+         fast reload, doq, windows-stop and dnstap.
+       - Fix fast reload test to check if pid exists before acting on it.
 
 1 April 2025: Wouter
        - Fix escape more characters when printing an RR type with an unquoted
index e7e644b7a56f3ece440dd53c440abf09e035b49f..969d0080df6377a0d6774c755ab1399c17ecd336 100644 (file)
@@ -10,7 +10,9 @@ PRE="../.."
 kill_pid $NS1_PID
 kill_pid $NS2_PID
 if test -f unbound.pid; then
-       kill_pid $UNBOUND_PID
+       if kill -0 $UNBOUND_PID >/dev/null 2>&1; then
+               kill_pid $UNBOUND_PID
+       fi
 fi
 rm -f $CONTROL_PATH/controlpipe.$CONTROL_PID
 echo
index 8cd87ec4e1d439d3090bf343547909711366ddc8..93fbaec17c018d59050f897b699e6e16d8b4485c 100644 (file)
@@ -46,6 +46,7 @@
 #include "util/log.h"
 #include "util/netevent.h"
 #include "util/tube.h"
+#include "daemon/remote.h"
 
 /* We define libevent structures here to hide the libevent stuff. */
 
@@ -95,9 +96,29 @@ UB_EV_BITS_CB(comm_timer_callback)
 UB_EV_BITS_CB(comm_signal_callback)
 UB_EV_BITS_CB(comm_point_local_handle_callback)
 UB_EV_BITS_CB(comm_point_raw_handle_callback)
-UB_EV_BITS_CB(comm_point_http_handle_callback)
 UB_EV_BITS_CB(tube_handle_signal)
 UB_EV_BITS_CB(comm_base_handle_slow_accept)
+UB_EV_BITS_CB(comm_point_http_handle_callback)
+#ifdef HAVE_NGTCP2
+UB_EV_BITS_CB(comm_point_doq_callback)
+#endif
+UB_EV_BITS_CB(fast_reload_service_cb)
+#ifdef USE_DNSTAP
+UB_EV_BITS_CB(dtio_output_cb)
+UB_EV_BITS_CB(dtio_cmd_cb)
+UB_EV_BITS_CB(dtio_reconnect_timeout_cb)
+UB_EV_BITS_CB(dtio_stop_timer_cb)
+UB_EV_BITS_CB(dtio_stop_ev_cb)
+UB_EV_BITS_CB(dtio_tap_callback)
+UB_EV_BITS_CB(dtio_mainfdcallback)
+#endif
+#ifdef HAVE_NGTCP2
+UB_EV_BITS_CB(doq_client_event_cb)
+UB_EV_BITS_CB(doq_client_timer_cb)
+#endif
+#ifdef UB_ON_WINDOWS
+UB_EV_BITS_CB(worker_win_stop_cb)
+#endif
 
 static void (*NATIVE_BITS_CB(void (*cb)(int, short, void*)))(int, short, void*)
 {
@@ -123,6 +144,38 @@ static void (*NATIVE_BITS_CB(void (*cb)(int, short, void*)))(int, short, void*)
                return my_tube_handle_signal;
        else if(cb == comm_base_handle_slow_accept)
                return my_comm_base_handle_slow_accept;
+#ifdef HAVE_NGTCP2
+       else if(cb == comm_point_doq_callback)
+               return my_comm_point_doq_callback;
+#endif
+       else if(cb == fast_reload_service_cb)
+               return my_fast_reload_service_cb;
+#ifdef USE_DNSTAP
+       else if(cb == dtio_output_cb)
+               return my_dtio_output_cb;
+       else if(cb == dtio_cmd_cb)
+               return my_dtio_cmd_cb;
+       else if(cb == dtio_reconnect_timeout_cb)
+               return my_dtio_reconnect_timeout_cb;
+       else if(cb == dtio_stop_timer_cb)
+               return my_dtio_stop_timer_cb;
+       else if(cb == dtio_stop_ev_cb)
+               return my_dtio_stop_ev_cb;
+       else if(cb == dtio_tap_callback)
+               return my_dtio_tap_callback;
+       else if(cb == dtio_mainfdcallback)
+               return my_dtio_mainfdcallback;
+#endif
+#ifdef HAVE_NGTCP2
+       else if(cb == doq_client_event_cb)
+               return my_doq_client_event_cb;
+       else if(cb == doq_client_timer_cb)
+               return my_doq_client_timer_cb;
+#endif
+#ifdef UB_ON_WINDOWS
+       else if(cb == worker_win_stop_cb)
+               return my_worker_win_stop_cb;
+#endif
        else {
                log_assert(0); /* this NULL callback pointer should not happen,
                        we should have the necessary routine listed above */