From 6d77141eccbb4e54d6024ed896f2fd332487abb2 Mon Sep 17 00:00:00 2001 From: Vladimir Dubrovin <3proxy@3proxy.ru> Date: Mon, 25 Apr 2022 13:09:55 +0300 Subject: [PATCH] Update socks.c --- src/socks.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/socks.c b/src/socks.c index ee3d5aa..3fedd00 100644 --- a/src/socks.c +++ b/src/socks.c @@ -305,6 +305,15 @@ fflush(stderr); param->res = 470; break; } + { +#ifdef _WIN32 + unsigned long ul=1; + ioctlsocket(param->remsock, FIONBIO, &ul); +#else + fcntl(param->remsock,F_SETFL,O_NONBLOCK | fcntl(param->remsock,F_GETFL)); +#endif + } + #if SOCKSTRACE > 0 fprintf(stderr, "Sending incoming connection to client with code %d for %s with %hu\n", param->res,