aboutsummaryrefslogtreecommitdiff
path: root/external/unbound/util/netevent.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2015-04-02 11:16:18 +0200
committerRiccardo Spagni <ric@spagni.net>2015-04-02 11:16:18 +0200
commit1f49833d4fc449d54c95c3235b5c18523e6f8d69 (patch)
treeae027273609339b9b89e3e546552af7a7afb23e7 /external/unbound/util/netevent.c
parentMerge pull request #248 (diff)
downloadmonero-1f49833d4fc449d54c95c3235b5c18523e6f8d69.tar.xz
update unbound from upstream
Diffstat (limited to 'external/unbound/util/netevent.c')
-rw-r--r--external/unbound/util/netevent.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/external/unbound/util/netevent.c b/external/unbound/util/netevent.c
index c7ed30e6c..9f1e86952 100644
--- a/external/unbound/util/netevent.c
+++ b/external/unbound/util/netevent.c
@@ -43,8 +43,8 @@
#include "util/log.h"
#include "util/net_help.h"
#include "util/fptr_wlist.h"
-#include "ldns/pkthdr.h"
-#include "ldns/sbuffer.h"
+#include "sldns/pkthdr.h"
+#include "sldns/sbuffer.h"
#include "dnstap/dnstap.h"
#ifdef HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
@@ -879,12 +879,12 @@ comm_point_tcp_accept_callback(int fd, short event, void* arg)
}
/* grab the tcp handler buffers */
+ c->cur_tcp_count++;
c->tcp_free = c_hdl->tcp_free;
if(!c->tcp_free) {
/* stop accepting incoming queries for now. */
comm_point_stop_listening(c);
}
- /* addr is dropped. Not needed for tcp reply. */
setup_tcp_handler(c_hdl, new_fd);
}
@@ -902,6 +902,7 @@ reclaim_tcp_handler(struct comm_point* c)
}
comm_point_close(c);
if(c->tcp_parent) {
+ c->tcp_parent->cur_tcp_count--;
c->tcp_free = c->tcp_parent->tcp_free;
c->tcp_parent->tcp_free = c;
if(!c->tcp_free) {
@@ -1528,6 +1529,7 @@ comm_point_create_udp(struct comm_base *base, int fd, sldns_buffer* buffer,
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_udp;
@@ -1578,6 +1580,7 @@ comm_point_create_udp_ancil(struct comm_base *base, int fd,
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_udp;
@@ -1639,6 +1642,7 @@ comm_point_create_tcp_handler(struct comm_base *base,
c->tcp_byte_count = 0;
c->tcp_parent = parent;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_tcp;
@@ -1691,6 +1695,7 @@ comm_point_create_tcp(struct comm_base *base, int fd, int num, size_t bufsize,
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = num;
+ c->cur_tcp_count = 0;
c->tcp_handlers = (struct comm_point**)calloc((size_t)num,
sizeof(struct comm_point*));
if(!c->tcp_handlers) {
@@ -1758,6 +1763,7 @@ comm_point_create_tcp_out(struct comm_base *base, size_t bufsize,
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_tcp;
@@ -1810,6 +1816,7 @@ comm_point_create_local(struct comm_base *base, int fd, size_t bufsize,
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_local;
@@ -1857,6 +1864,7 @@ comm_point_create_raw(struct comm_base* base, int fd, int writing,
c->tcp_byte_count = 0;
c->tcp_parent = NULL;
c->max_tcp_count = 0;
+ c->cur_tcp_count = 0;
c->tcp_handlers = NULL;
c->tcp_free = NULL;
c->type = comm_raw;