From: W.C.A. Wijngaards Date: Fri, 16 Jul 2021 07:12:06 +0000 (+0200) Subject: - Fix for #510: in depth, use ifdefs for windows api event calls. X-Git-Tag: release-1.13.2rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8180ca192fc9b06fb65df25aff2661b851aa9e10;p=thirdparty%2Funbound.git - Fix for #510: in depth, use ifdefs for windows api event calls. --- diff --git a/doc/Changelog b/doc/Changelog index 7f12eec94..e0ee3a83b 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -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. diff --git a/util/netevent.c b/util/netevent.c index ede19726a..01e44c9b6 100644 --- a/util/netevent.c +++ b/util/netevent.c @@ -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); }