From 3687db3e3817a14e3d8e2be28a5ebec841707cdb Mon Sep 17 00:00:00 2001 From: Enrique Date: Sun, 20 Apr 2025 21:01:55 +0200 Subject: Added a timeout to poll so it doesnt return immediately --- src/net/net.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/net/net.c b/src/net/net.c index d0bf233..f4a66d6 100755 --- a/src/net/net.c +++ b/src/net/net.c @@ -262,7 +262,7 @@ static inline int worker_read(http_worker *hw, str *buf){ int receive_request(http_worker *hw, str *request){ // for some reason SSL_has_pending can return 0 but we can still read data struct pollfd pfd[1] = { {.fd = hw->csocket, .events = POLLIN } }; - while((hw->secure && SSL_has_pending(hw->ssl)) || poll(pfd, 1, 0)){ + while((hw->secure && SSL_has_pending(hw->ssl)) || poll(pfd, 1, 100)){ int new = worker_read(hw, request); if(new < 0 || (hw->secure && new == 0)){ int error = new; -- cgit v1.2.3