]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix close events for tcp only.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 25 May 2018 10:41:24 +0000 (10:41 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 25 May 2018 10:41:24 +0000 (10:41 +0000)
git-svn-id: file:///svn/unbound/trunk@4695 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
util/netevent.c

index 05dc9461734c5e8f659ec9f62161cf54bb42a9a4..ab71c48e36bfbb016df165292a2b7970d207648e 100644 (file)
@@ -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.
index 8390d35db86387c467079e19ab7b58eec8a228a7..f90179e75245bd3cffae394e584a373ffafe0027 100644 (file)
@@ -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);