]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
cleanup dropped tcp.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 7 Feb 2007 15:53:51 +0000 (15:53 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Wed, 7 Feb 2007 15:53:51 +0000 (15:53 +0000)
git-svn-id: file:///svn/unbound/trunk@77 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/worker.c
util/netevent.c
util/netevent.h

index 47ac7f4227369891a48f51fd8d61d221d1a97332..918cbabbb6d3fba764e6c91db3ec138bca76234b 100644 (file)
@@ -165,11 +165,13 @@ worker_handle_request(struct comm_point* c, void* arg, int error,
                        LDNS_RCODE_SET(ldns_buffer_begin(c->buffer), ret);
                        return 1;
                }
+               comm_point_drop_reply(repinfo);
                return 0;
        }
        if(worker->num_requests > 0) {
                verbose(VERB_DETAIL, "worker: too many requests active. "
                        "dropping incoming query.");
+               comm_point_drop_reply(repinfo);
                return 0;
        }
        /* answer it */
index 6824afbd2e175fcac97e2cec396c7cc9a9fc334b..cc4f2d5f3e78e02eac43b0e313286f5918ae1d81 100644 (file)
@@ -693,7 +693,20 @@ comm_point_send_reply(struct comm_reply *repinfo)
        }
 }
 
-void comm_point_stop_listening(struct comm_point* c)
+void 
+comm_point_drop_reply(struct comm_reply* repinfo)
+{
+       if(!repinfo)
+               return;
+       log_assert(repinfo && repinfo->c);
+       log_assert(repinfo->c->type != comm_tcp_accept);
+       if(repinfo->c->type == comm_udp)
+               return;
+       reclaim_tcp_handler(repinfo->c);
+}
+
+void 
+comm_point_stop_listening(struct comm_point* c)
 {
        log_info("comm point stop listening %x", (int)c);
        if(event_del(&c->ev->ev) != 0) {
@@ -701,7 +714,8 @@ void comm_point_stop_listening(struct comm_point* c)
        }
 }
 
-void comm_point_start_listening(struct comm_point* c, int newfd, int sec)
+void 
+comm_point_start_listening(struct comm_point* c, int newfd, int sec)
 {
        log_info("comm point start listening %x", (int)c);
        if(c->type == comm_tcp_accept && !c->tcp_free) {
index 4c0508e16ae7231c165cc42fc9a638924d37fa72..9822936eab1c00e809a9f05965be7350e42e623f 100644 (file)
@@ -309,6 +309,12 @@ void comm_point_set_cb_arg(struct comm_point* c, void* arg);
  */
 void comm_point_send_reply(struct comm_reply* repinfo);
 
+/**
+ * Drop reply. Cleans up.
+ * @param repinfo: The reply info copied from a commpoint callback call.
+ */
+void comm_point_drop_reply(struct comm_reply* repinfo);
+
 /**
  * Send an udp message over a commpoint.
  * @param c: commpoint to send it from.