mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-08 17:13:56 +00:00
Added SSL read error fix thanks to H.S.S.
This commit is contained in:
parent
c76272a5af
commit
ee11f4ae53
10
src/elogd.c
10
src/elogd.c
@ -30031,9 +30031,15 @@ void server_loop(void) {
|
|||||||
status = select(FD_SETSIZE, (void *) &readfds, NULL, NULL, (void *) &timeout);
|
status = select(FD_SETSIZE, (void *) &readfds, NULL, NULL, (void *) &timeout);
|
||||||
if (FD_ISSET(_sock, &readfds)) {
|
if (FD_ISSET(_sock, &readfds)) {
|
||||||
#ifdef HAVE_SSL
|
#ifdef HAVE_SSL
|
||||||
if (_ssl_flag)
|
if (_ssl_flag) {
|
||||||
i = SSL_read(_ssl_con, net_buffer + len, net_buffer_size - len);
|
i = SSL_read(_ssl_con, net_buffer + len, net_buffer_size - len);
|
||||||
else
|
if (i <= 0) {
|
||||||
|
int ssl_error = SSL_get_error(_ssl_con, i);
|
||||||
|
if (ssl_error == SSL_ERROR_WANT_READ ||
|
||||||
|
ssl_error == SSL_ERROR_WANT_WRITE)
|
||||||
|
continue; // continue reading if SSL layer wants more data
|
||||||
|
}
|
||||||
|
} else
|
||||||
#endif
|
#endif
|
||||||
i = recv(_sock, net_buffer + len, net_buffer_size - len, 0);
|
i = recv(_sock, net_buffer + len, net_buffer_size - len, 0);
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user