diff options
author | stderr64 <linuxwizard@voidnet.dy.fi> | 2023-09-10 18:43:03 +0300 |
---|---|---|
committer | stderr64 <linuxwizard@voidnet.dy.fi> | 2023-09-10 18:43:03 +0300 |
commit | e82c650bc481024cf42e916aee7f096f915855a1 (patch) | |
tree | e7d79a004a1e1d14ac608fc52274ed7add290d00 | |
parent | f484331cf374031f68566162f16ba00eedc1b7f0 (diff) | |
download | CWebHook-e82c650bc481024cf42e916aee7f096f915855a1.tar.gz CWebHook-e82c650bc481024cf42e916aee7f096f915855a1.tar.zst |
Added extra check if the even is POLLIN
-rw-r--r-- | https_server.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/https_server.h b/https_server.h index 4b1776f..8f5381d 100644 --- a/https_server.h +++ b/https_server.h @@ -19,7 +19,7 @@ void https_server_event_loop( server_socket_t *sv, client_info_t *cl, server_con int ev_count = 0; socklen_t cl_info_len = (socklen_t)sizeof( sv->client_info ); while ( (ev_count = poll(sv->pstruct, 1, 0)) != -1 ){ - if ( ev_count > 0 ){ + if ( (ev_count > 0) && sv->pstruct->revents & POLLIN ){ sv->client_socket_fd = accept( sv->socket_fd, (struct sockaddr*)&sv->client_info, &cl_info_len ); if ( sv->client_socket_fd == -1 ){ log_write( svcfg, logf, "Error: failed to accept connection" ); |