Skip to content

Commit

Permalink
only process write events if file descriptor has not been tidied (may f…
Browse files Browse the repository at this point in the history
…ix #355)
  • Loading branch information
yrutschle committed Nov 3, 2022
1 parent d166b89 commit 02573eb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sslh-select.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,10 @@ void main_loop(struct listen_endpoint listen_sockets[], int num_addr_listen)

/* Check all sockets for write activity */
for (i = 0; i < fd_info.watchers->max_fd; i++) {
if (FD_ISSET(i, &writefds)) {
/* Check if it's active AND currently monitored (if a connection
* died, it gets tidied, which closes both sockets, but writefs does
* not know about that */
if (FD_ISSET(i, &writefds) && FD_ISSET(i, &fd_info.watchers->fds_w)) {
cnx_write_process(&fd_info, i);
}
}
Expand Down

0 comments on commit 02573eb

Please sign in to comment.