]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
- Fix for #510: in depth, use ifdefs for windows api event calls.
authorW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 Jul 2021 07:12:06 +0000 (09:12 +0200)
committerW.C.A. Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 Jul 2021 07:12:06 +0000 (09:12 +0200)
doc/Changelog
util/netevent.c

index 7f12eec94ea8f445c79319770bad7639b1fa6d11..e0ee3a83bf92e94c5d96c586a571249b23ec133c 100644 (file)
@@ -1,3 +1,8 @@
+16 July 2021: Wouter
+       - Merge #510 from ndptech: Don't call a function which hasn't been
+         defined.
+       - Fix for #510: in depth, use ifdefs for windows api event calls.
+
 6 July 2021: Wouter
        - iana portlist update.
 
index ede19726acda830fe14276f55dd638e0b086f860..01e44c9b6f301163189bb267fdfe7e400a3f922d 100644 (file)
@@ -1364,7 +1364,9 @@ ssl_handle_read(struct comm_point* c)
                                        return tcp_req_info_handle_read_close(c->tcp_req_info);
                                return 0; /* shutdown, closed */
                        } else if(want == SSL_ERROR_WANT_READ) {
+#ifdef USE_WINSOCK
                                ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ);
+#endif
                                return 1; /* read more later */
                        } else if(want == SSL_ERROR_WANT_WRITE) {
                                c->ssl_shake_state = comm_ssl_shake_hs_write;
@@ -1412,7 +1414,9 @@ ssl_handle_read(struct comm_point* c)
                                        return tcp_req_info_handle_read_close(c->tcp_req_info);
                                return 0; /* shutdown, closed */
                        } else if(want == SSL_ERROR_WANT_READ) {
+#ifdef USE_WINSOCK
                                ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ);
+#endif
                                return 1; /* read more later */
                        } else if(want == SSL_ERROR_WANT_WRITE) {
                                c->ssl_shake_state = comm_ssl_shake_hs_write;
@@ -1505,7 +1509,9 @@ ssl_handle_write(struct comm_point* c)
                                comm_point_listen_for_rw(c, 1, 0);
                                return 1; /* wait for read condition */
                        } else if(want == SSL_ERROR_WANT_WRITE) {
+#ifdef USE_WINSOCK
                                ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE);
+#endif
                                return 1; /* write more later */
                        } else if(want == SSL_ERROR_SYSCALL) {
 #ifdef EPIPE
@@ -1555,7 +1561,9 @@ ssl_handle_write(struct comm_point* c)
                        comm_point_listen_for_rw(c, 1, 0);
                        return 1; /* wait for read condition */
                } else if(want == SSL_ERROR_WANT_WRITE) {
+#ifdef USE_WINSOCK
                        ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE);
+#endif
                        return 1; /* write more later */
                } else if(want == SSL_ERROR_SYSCALL) {
 #ifdef EPIPE
@@ -3940,11 +3948,13 @@ comm_point_close(struct comm_point* c)
 
        /* close fd after removing from event lists, or epoll.. is messed up */
        if(c->fd != -1 && !c->do_not_close) {
+#ifdef USE_WINSOCK
                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);
                }
+#endif
                verbose(VERB_ALGO, "close fd %d", c->fd);
                sock_close(c->fd);
        }