From a3df50f31fcfd9d76bd5cb8c97440a9092dafdf2 Mon Sep 17 00:00:00 2001 From: Oleg Oshmyan Date: Sat, 9 Sep 2017 00:35:42 +0300 Subject: [PATCH] sslh-select: fix connections with deferred data after connect_queue Previously, if some data was still deferred after the connect_queue call, the server side of the connection would never start being monitored for reads, while the client side kept being monitored and new data from the client could be sent to the server before the previously deferred data. --- sslh-select.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sslh-select.c b/sslh-select.c index db05645..765284e 100644 --- a/sslh-select.c +++ b/sslh-select.c @@ -140,9 +140,9 @@ int connect_queue(struct connection *cnx, fd_set *fds_r, fd_set *fds_w) flush_deferred(q); if (q->deferred_data) { FD_SET(q->fd, fds_w); - } else { - FD_SET(q->fd, fds_r); + FD_CLR(cnx->q[0].fd, fds_r); } + FD_SET(q->fd, fds_r); return q->fd; } else { tidy_connection(cnx, fds_r, fds_w);