commit f1ba9b430e0ae547b62f25d40130eb26502f2bcb
parent 2da6d2d8002370a3597f3080350920c8c26b85c3
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Mon, 28 Dec 2020 09:58:40 +0300
mhd_send: do not emulate sendmsg() on blocking sockets
If OS doesn't support non-blocking sockets then additional call of
select() or poll() is required to lower chances of being blocked.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
@@ -884,7 +884,8 @@ MHD_send_hdr_and_body_ (struct MHD_Connection *connection,
if ( (header_size == (size_t) ret) &&
((size_t) SSIZE_MAX > header_size) &&
- (0 != body_size) )
+ (0 != body_size) &&
+ (connection->sk_nonblck) )
{
ssize_t ret2;
/* The header has been sent completely.