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);
/**
* 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
*/
#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);
}
/* --- 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),
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),
* 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