From d4ba7731ad3689da92db3e1cf1ed041098c9446c Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Fri, 25 May 2018 10:02:06 +0000 Subject: [PATCH] - Fix that tcp sticky events are removed for closed fd on windows. git-svn-id: file:///svn/unbound/trunk@4694 be551aaa-1e26-0410-a405-d3ace91eadb9 --- doc/Changelog | 1 + util/netevent.c | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/Changelog b/doc/Changelog index 7046f9c9f..05dc94617 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -1,6 +1,7 @@ 25 May 2018: Wouter - 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. 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 3c3537856..8390d35db 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -2900,10 +2900,14 @@ comm_point_close(struct comm_point* c) { if(!c) return; - if(c->fd != -1) + if(c->fd != -1) { 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) { verbose(VERB_ALGO, "close fd %d", c->fd);