From: George Thessalonikefs Date: Tue, 13 Apr 2021 12:54:26 +0000 (+0200) Subject: - Remove unused functions worker_handle_reply and X-Git-Tag: release-1.13.2rc1~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13e445d50b6e2a9441d9364d4213a57781d9e6f1;p=thirdparty%2Funbound.git - Remove unused functions worker_handle_reply and libworker_handle_reply. --- diff --git a/daemon/worker.c b/daemon/worker.c index ffe7ff2d4..7bd64bce4 100644 --- a/daemon/worker.c +++ b/daemon/worker.c @@ -236,38 +236,6 @@ worker_send_cmd(struct worker* worker, enum worker_commands cmd) } } -int -worker_handle_reply(struct comm_point* c, void* arg, int error, - struct comm_reply* reply_info) -{ - struct module_qstate* q = (struct module_qstate*)arg; - struct worker* worker = q->env->worker; - struct outbound_entry e; - e.qstate = q; - e.qsent = NULL; - - if(error != 0) { - mesh_report_reply(worker->env.mesh, &e, reply_info, error); - worker_mem_report(worker, NULL); - return 0; - } - /* sanity check. */ - if(!LDNS_QR_WIRE(sldns_buffer_begin(c->buffer)) - || LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) != - LDNS_PACKET_QUERY - || LDNS_QDCOUNT(sldns_buffer_begin(c->buffer)) > 1) { - /* error becomes timeout for the module as if this reply - * never arrived. */ - mesh_report_reply(worker->env.mesh, &e, reply_info, - NETEVENT_TIMEOUT); - worker_mem_report(worker, NULL); - return 0; - } - mesh_report_reply(worker->env.mesh, &e, reply_info, NETEVENT_NOERROR); - worker_mem_report(worker, NULL); - return 0; -} - int worker_handle_service_reply(struct comm_point* c, void* arg, int error, struct comm_reply* reply_info) @@ -2077,14 +2045,6 @@ struct outbound_entry* libworker_send_query( return 0; } -int libworker_handle_reply(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) -{ - log_assert(0); - return 0; -} - int libworker_handle_service_reply(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), struct comm_reply* ATTR_UNUSED(reply_info)) diff --git a/dnstap/unbound-dnstap-socket.c b/dnstap/unbound-dnstap-socket.c index 8e28be4e8..9eaf01243 100644 --- a/dnstap/unbound-dnstap-socket.c +++ b/dnstap/unbound-dnstap-socket.c @@ -1375,14 +1375,6 @@ int worker_handle_request(struct comm_point* ATTR_UNUSED(c), return 0; } -int worker_handle_reply(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) -{ - log_assert(0); - return 0; -} - int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), struct comm_reply* ATTR_UNUSED(reply_info)) @@ -1456,14 +1448,6 @@ struct outbound_entry* libworker_send_query( return 0; } -int libworker_handle_reply(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) -{ - log_assert(0); - return 0; -} - int libworker_handle_service_reply(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), struct comm_reply* ATTR_UNUSED(reply_info)) diff --git a/doc/Changelog b/doc/Changelog index 8abea8ee6..af6ee1ab1 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,5 +1,6 @@ 13 April 2021: George - Fix documentation comment for files previously residing in checkconf/. + - Remove unused functions worker_handle_reply and libworker_handle_reply. 13 April 2021: Wouter - Fix that nxdomain synthesis does not happen above the stub or diff --git a/libunbound/libworker.c b/libunbound/libworker.c index 7f46df386..2b7f7a1e4 100644 --- a/libunbound/libworker.c +++ b/libunbound/libworker.c @@ -876,35 +876,6 @@ struct outbound_entry* libworker_send_query(struct query_info* qinfo, return e; } -int -libworker_handle_reply(struct comm_point* c, void* arg, int error, - struct comm_reply* reply_info) -{ - struct module_qstate* q = (struct module_qstate*)arg; - struct libworker* lw = (struct libworker*)q->env->worker; - struct outbound_entry e; - e.qstate = q; - e.qsent = NULL; - - if(error != 0) { - mesh_report_reply(lw->env->mesh, &e, reply_info, error); - return 0; - } - /* sanity check. */ - if(!LDNS_QR_WIRE(sldns_buffer_begin(c->buffer)) - || LDNS_OPCODE_WIRE(sldns_buffer_begin(c->buffer)) != - LDNS_PACKET_QUERY - || LDNS_QDCOUNT(sldns_buffer_begin(c->buffer)) > 1) { - /* error becomes timeout for the module as if this reply - * never arrived. */ - mesh_report_reply(lw->env->mesh, &e, reply_info, - NETEVENT_TIMEOUT); - return 0; - } - mesh_report_reply(lw->env->mesh, &e, reply_info, NETEVENT_NOERROR); - return 0; -} - int libworker_handle_service_reply(struct comm_point* c, void* arg, int error, struct comm_reply* reply_info) @@ -947,14 +918,6 @@ int worker_handle_request(struct comm_point* ATTR_UNUSED(c), return 0; } -int worker_handle_reply(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) -{ - log_assert(0); - return 0; -} - int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), struct comm_reply* ATTR_UNUSED(reply_info)) diff --git a/libunbound/worker.h b/libunbound/worker.h index fe1d51878..bf7473861 100644 --- a/libunbound/worker.h +++ b/libunbound/worker.h @@ -75,10 +75,6 @@ struct outbound_entry* libworker_send_query(struct query_info* qinfo, size_t zonelen, int ssl_upstream, char* tls_auth_name, struct module_qstate* q); -/** process incoming replies from the network */ -int libworker_handle_reply(struct comm_point* c, void* arg, int error, - struct comm_reply* reply_info); - /** process incoming serviced query replies from the network */ int libworker_handle_service_reply(struct comm_point* c, void* arg, int error, struct comm_reply* reply_info); @@ -146,10 +142,6 @@ void worker_handle_control_cmd(struct tube* tube, uint8_t* msg, size_t len, int worker_handle_request(struct comm_point* c, void* arg, int error, struct comm_reply* repinfo); -/** process incoming replies from the network */ -int worker_handle_reply(struct comm_point* c, void* arg, int error, - struct comm_reply* reply_info); - /** process incoming serviced query replies from the network */ int worker_handle_service_reply(struct comm_point* c, void* arg, int error, struct comm_reply* reply_info); diff --git a/smallapp/worker_cb.c b/smallapp/worker_cb.c index 63c27fda2..473e32a60 100644 --- a/smallapp/worker_cb.c +++ b/smallapp/worker_cb.c @@ -65,14 +65,6 @@ int worker_handle_request(struct comm_point* ATTR_UNUSED(c), return 0; } -int worker_handle_reply(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) -{ - log_assert(0); - return 0; -} - int worker_handle_service_reply(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), struct comm_reply* ATTR_UNUSED(reply_info)) @@ -146,14 +138,6 @@ struct outbound_entry* libworker_send_query( return 0; } -int libworker_handle_reply(struct comm_point* ATTR_UNUSED(c), - void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), - struct comm_reply* ATTR_UNUSED(reply_info)) -{ - log_assert(0); - return 0; -} - int libworker_handle_service_reply(struct comm_point* ATTR_UNUSED(c), void* ATTR_UNUSED(arg), int ATTR_UNUSED(error), struct comm_reply* ATTR_UNUSED(reply_info)) diff --git a/util/fptr_wlist.c b/util/fptr_wlist.c index 2b01e533c..de6dbd02a 100644 --- a/util/fptr_wlist.c +++ b/util/fptr_wlist.c @@ -196,8 +196,6 @@ int fptr_whitelist_pending_udp(comm_point_callback_type *fptr) { if(fptr == &serviced_udp_callback) return 1; - else if(fptr == &worker_handle_reply) return 1; - else if(fptr == &libworker_handle_reply) return 1; return 0; } @@ -205,8 +203,6 @@ int fptr_whitelist_pending_tcp(comm_point_callback_type *fptr) { if(fptr == &serviced_tcp_callback) return 1; - else if(fptr == &worker_handle_reply) return 1; - else if(fptr == &libworker_handle_reply) return 1; return 0; }