]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Remove unused functions worker_handle_reply and
authorGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 13 Apr 2021 12:54:26 +0000 (14:54 +0200)
committerGeorge Thessalonikefs <george@nlnetlabs.nl>
Tue, 13 Apr 2021 12:54:26 +0000 (14:54 +0200)
  libworker_handle_reply.

daemon/worker.c
dnstap/unbound-dnstap-socket.c
doc/Changelog
libunbound/libworker.c
libunbound/worker.h
smallapp/worker_cb.c
util/fptr_wlist.c

index ffe7ff2d417632256931aaef7ca63f3559363248..7bd64bce48aca96b9722049ed4d327a41fcc8fd9 100644 (file)
@@ -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))
index 8e28be4e89ecfbd78131f956dd4ab653e2948f4c..9eaf01243e1b835efc53a947af0f71cd1b5d3d9f 100644 (file)
@@ -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))
index 8abea8ee62b804135c0a4acb584e088e9d50c9ca..af6ee1ab1d7ed9f44471a47efd42e550b9f3e853 100644 (file)
@@ -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
index 7f46df386ab9a9e7fb327fd3b93303ac3f3bea75..2b7f7a1e490fa3f07fcd01de6956e1db2e2a1133 100644 (file)
@@ -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))
index fe1d51878a89788455465e2144abc505c698fb90..bf7473861af8a21ca871427f073460963f3dcdba 100644 (file)
@@ -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);
index 63c27fda28789db4a3b8563311f84774ae9e65af..473e32a607f8954f416cfab32c37a4571f622420 100644 (file)
@@ -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))
index 2b01e533c97f4cfcf9438db3dc458b59c9d82d4a..de6dbd02a37d6b27766be6712b22d9295a7b69bc 100644 (file)
@@ -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;
 }