diff --git a/daemon/worker.c b/daemon/worker.c index 9512f447c..d0e276c57 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -999,7 +999,7 @@ worker_init(struct worker* worker, struct config_file *cfg, if(worker->thread_num != 0) { /* start listening to commands */ if(!tube_listen_cmd(worker->cmd, worker->base, - cfg->msg_buffer_size, worker_handle_control_cmd, + cfg->msg_buffer_size, &worker_handle_control_cmd, worker)) { log_err("could not create control compt."); worker_delete(worker); diff --git a/daemon/worker.h b/daemon/worker.h index 55def23af..2823d4003 100644 --- a/daemon/worker.h +++ b/daemon/worker.h @@ -199,7 +199,7 @@ struct outbound_entry* worker_send_query(uint8_t* qname, size_t qnamelen, /** * process control messages from the main thread. * @param tube: tube control message came on. - * @param buf: buffer with message in it. + * @param buffer: buffer with message in it. * @param error: if error (NETEVENT_*) happened. * @param arg: user argument */ diff --git a/libunbound/libworker.c b/libunbound/libworker.c index 68f98e5e0..629eb3f6b 100644 --- a/libunbound/libworker.c +++ b/libunbound/libworker.c @@ -60,6 +60,7 @@ #include "util/data/dname.h" #include "util/data/msgreply.h" #include "util/data/msgencode.h" +#include "util/tube.h" /** handle new query command for bg worker */ static void handle_newq(struct libworker* w, uint8_t* buf, uint32_t len); @@ -963,12 +964,11 @@ libworker_read_msg(int fd, uint8_t** buf, uint32_t* len, int nonblock) } /* --- fake callbacks for fptr_wlist to work --- */ -int worker_handle_control_cmd(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) +void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube), + ldns_buffer* ATTR_UNUSED(buffer), int ATTR_UNUSED(error), + void* ATTR_UNUSED(arg)) { log_assert(0); - return 0; } int worker_handle_request(struct comm_point* ATTR_UNUSED(c), diff --git a/smallapp/worker_cb.c b/smallapp/worker_cb.c index 92e087e33..54d1f1fc8 100644 --- a/smallapp/worker_cb.c +++ b/smallapp/worker_cb.c @@ -45,13 +45,13 @@ struct comm_reply; struct comm_point; struct module_qstate; +struct tube; -int worker_handle_control_cmd(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) +void worker_handle_control_cmd(struct tube* ATTR_UNUSED(tube), + ldns_buffer* ATTR_UNUSED(buffer), int ATTR_UNUSED(error), + void* ATTR_UNUSED(arg)) { log_assert(0); - return 0; } int worker_handle_request(struct comm_point* ATTR_UNUSED(c), diff --git a/util/tube.h b/util/tube.h index 00092ec91..fecd1cf33 100644 --- a/util/tube.h +++ b/util/tube.h @@ -50,8 +50,7 @@ struct tube; * void mycallback(tube, buffer, error, argument); * if error is true (NETEVENT_*), buffer is probably NULL. */ -typedef void (tube_callback_t)(struct tube* tube, ldns_buffer* buffer, - int error, void* arg); +typedef void tube_callback_t(struct tube*, ldns_buffer*, int, void*); /** * A pipe