]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix #4227: pair event del and add for libevent for tcp_req_info.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 25 Feb 2019 15:48:27 +0000 (15:48 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 25 Feb 2019 15:48:27 +0000 (15:48 +0000)
git-svn-id: file:///svn/unbound/trunk@5122 be551aaa-1e26-0410-a405-d3ace91eadb9

doc/Changelog
services/listen_dnsport.c
util/netevent.c

index 40210c995248638d98bbec41dd144e6d5926e582..89c0eb3df61b8d0fd005f6ee6a5a8dc49cafed64 100644 (file)
@@ -1,3 +1,6 @@
+25 February 2019: Wouter
+       - Fix #4227: pair event del and add for libevent for tcp_req_info.
+
 21 February 2019: Wouter
        - Fix the error for unknown module in module-config is understandable,
          and explains it was not compiled in and where to see the list.
index 664072aa4833c33fb72f0c214f3d27a72153b4d3..e74d1abcffc5152fc503b9a9cbb897e5017fa307 100644 (file)
@@ -1636,10 +1636,12 @@ tcp_req_info_setup_listen(struct tcp_req_info* req)
        
        if(wr) {
                req->cp->tcp_is_reading = 0;
+               comm_point_stop_listening(req->cp);
                comm_point_start_listening(req->cp, -1,
                        req->cp->tcp_timeout_msec);
        } else if(rd) {
                req->cp->tcp_is_reading = 1;
+               comm_point_stop_listening(req->cp);
                comm_point_start_listening(req->cp, -1,
                        req->cp->tcp_timeout_msec);
                /* and also read it (from SSL stack buffers), so
@@ -1647,6 +1649,7 @@ tcp_req_info_setup_listen(struct tcp_req_info* req)
                 * the TLS frame is sitting in the buffers. */
                req->read_again = 1;
        } else {
+               comm_point_stop_listening(req->cp);
                comm_point_start_listening(req->cp, -1,
                        req->cp->tcp_timeout_msec);
                comm_point_listen_for_rw(req->cp, 0, 0);
@@ -1759,6 +1762,7 @@ tcp_req_info_handle_readdone(struct tcp_req_info* req)
                 * clear to write to */
        send_it:
                c->tcp_is_reading = 0;
+               comm_point_stop_listening(c);
                comm_point_start_listening(c, -1, c->tcp_timeout_msec);
                return;
        }
index a507faf7e41189e3ba87d20f8edc122cde40c502..f33e44058b11d0a885a475a0109738cb373bc664 100644 (file)
@@ -989,10 +989,10 @@ tcp_callback_writer(struct comm_point* c)
                c->tcp_is_reading = 1;
        c->tcp_byte_count = 0;
        /* switch from listening(write) to listening(read) */
-       comm_point_stop_listening(c);
        if(c->tcp_req_info) {
                tcp_req_info_handle_writedone(c->tcp_req_info);
        } else {
+               comm_point_stop_listening(c);
                comm_point_start_listening(c, -1, -1);
        }
 }
@@ -1006,11 +1006,11 @@ tcp_callback_reader(struct comm_point* c)
        if(c->tcp_do_toggle_rw)
                c->tcp_is_reading = 0;
        c->tcp_byte_count = 0;
-       if(c->type == comm_tcp)
-               comm_point_stop_listening(c);
        if(c->tcp_req_info) {
                tcp_req_info_handle_readdone(c->tcp_req_info);
        } else {
+               if(c->type == comm_tcp)
+                       comm_point_stop_listening(c);
                fptr_ok(fptr_whitelist_comm_point(c->callback));
                if( (*c->callback)(c, c->cb_arg, NETEVENT_NOERROR, &c->repinfo) ) {
                        comm_point_start_listening(c, -1, c->tcp_timeout_msec);