- Fix for #510: in depth, use ifdefs for windows api event calls.

This commit is contained in:
W.C.A. Wijngaards 2021-07-16 09:12:06 +02:00
parent 410f202a93
commit 8180ca192f
2 changed files with 15 additions and 0 deletions

View 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 6 July 2021: Wouter
- iana portlist update. - iana portlist update.

View file

@ -1364,7 +1364,9 @@ ssl_handle_read(struct comm_point* c)
return tcp_req_info_handle_read_close(c->tcp_req_info); return tcp_req_info_handle_read_close(c->tcp_req_info);
return 0; /* shutdown, closed */ return 0; /* shutdown, closed */
} else if(want == SSL_ERROR_WANT_READ) { } else if(want == SSL_ERROR_WANT_READ) {
#ifdef USE_WINSOCK
ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ); ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ);
#endif
return 1; /* read more later */ return 1; /* read more later */
} else if(want == SSL_ERROR_WANT_WRITE) { } else if(want == SSL_ERROR_WANT_WRITE) {
c->ssl_shake_state = comm_ssl_shake_hs_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 tcp_req_info_handle_read_close(c->tcp_req_info);
return 0; /* shutdown, closed */ return 0; /* shutdown, closed */
} else if(want == SSL_ERROR_WANT_READ) { } else if(want == SSL_ERROR_WANT_READ) {
#ifdef USE_WINSOCK
ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ); ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_READ);
#endif
return 1; /* read more later */ return 1; /* read more later */
} else if(want == SSL_ERROR_WANT_WRITE) { } else if(want == SSL_ERROR_WANT_WRITE) {
c->ssl_shake_state = comm_ssl_shake_hs_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); comm_point_listen_for_rw(c, 1, 0);
return 1; /* wait for read condition */ return 1; /* wait for read condition */
} else if(want == SSL_ERROR_WANT_WRITE) { } else if(want == SSL_ERROR_WANT_WRITE) {
#ifdef USE_WINSOCK
ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE);
#endif
return 1; /* write more later */ return 1; /* write more later */
} else if(want == SSL_ERROR_SYSCALL) { } else if(want == SSL_ERROR_SYSCALL) {
#ifdef EPIPE #ifdef EPIPE
@ -1555,7 +1561,9 @@ ssl_handle_write(struct comm_point* c)
comm_point_listen_for_rw(c, 1, 0); comm_point_listen_for_rw(c, 1, 0);
return 1; /* wait for read condition */ return 1; /* wait for read condition */
} else if(want == SSL_ERROR_WANT_WRITE) { } else if(want == SSL_ERROR_WANT_WRITE) {
#ifdef USE_WINSOCK
ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE);
#endif
return 1; /* write more later */ return 1; /* write more later */
} else if(want == SSL_ERROR_SYSCALL) { } else if(want == SSL_ERROR_SYSCALL) {
#ifdef EPIPE #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 */ /* close fd after removing from event lists, or epoll.. is messed up */
if(c->fd != -1 && !c->do_not_close) { if(c->fd != -1 && !c->do_not_close) {
#ifdef USE_WINSOCK
if(c->type == comm_tcp || c->type == comm_http) { if(c->type == comm_tcp || c->type == comm_http) {
/* delete sticky events for the fd, it gets closed */ /* 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_READ);
ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE); ub_winsock_tcp_wouldblock(c->ev->ev, UB_EV_WRITE);
} }
#endif
verbose(VERB_ALGO, "close fd %d", c->fd); verbose(VERB_ALGO, "close fd %d", c->fd);
sock_close(c->fd); sock_close(c->fd);
} }