From: Wouter Wijngaards Date: Fri, 25 May 2018 10:41:24 +0000 (+0000) Subject: - Fix close events for tcp only. X-Git-Tag: release-1.7.2rc1~10 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d32fb26adbf615a0b90acd5b7bebe30f9e4ac20b;p=thirdparty%2Funbound.git - Fix close events for tcp only. git-svn-id: file:///svn/unbound/trunk@4695 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 05dc94617..ab71c48e3 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -2,6 +2,7 @@ - For TCP and TLS connections that don't establish, perform address update in infra cache, so future selections can exclude them. - Fix that tcp sticky events are removed for closed fd on windows. + - Fix close events for tcp only. 24 May 2018: Wouter - Fix that libunbound can do DNS-over-TLS, when configured. diff --git a/util/netevent.c b/util/netevent.c index 8390d35db..f90179e75 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -2904,12 +2904,14 @@ comm_point_close(struct comm_point* c) if(ub_event_del(c->ev->ev) != 0) { log_err("could not event_del on close"); } - /* delete sticky events for the fr, it gets closed */ - ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ); - ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); } /* close fd after removing from event lists, or epoll.. is messed up */ if(c->fd != -1 && !c->do_not_close) { + if(c->type == comm_tcp || c->type == comm_http) { + /* delete sticky events for the fd, it gets closed */ + ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ); + ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); + } verbose(VERB_ALGO, "close fd %d", c->fd); #ifndef USE_WINSOCK close(c->fd);