From 22f62fcf774a42a5db951b685a1ad57ea6c77ca1 Mon Sep 17 00:00:00 2001 From: DanyLE Date: Fri, 21 Oct 2022 12:04:41 +0200 Subject: [PATCH] fix: SSL socket polling bug --- lua-api.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lua-api.c b/lua-api.c index 878e5c3..ab36309 100644 --- a/lua-api.c +++ b/lua-api.c @@ -209,6 +209,10 @@ static void *process(void *data) struct pollfd pfds[2]; pfds[0].fd = rq->client->sock; pfds[0].events = POLLIN; + if(rq->client->ssl) + { + pfds[0].events = POLLIN | POLLOUT; + } pfds[1].fd = cl->sock; pfds[1].events = POLLIN; @@ -232,7 +236,7 @@ static void *process(void *data) // we have data default: // If data is on webserver - if (pfds[0].revents & POLLIN) + if ((pfds[0].revents & POLLIN) || (rq->client->ssl && (pfds[0].revents & POLLOUT)) ) { while((ret = antd_recv_upto(rq->client,buff, BUFFLEN)) > 0) {