From f06d01317db1fa58ff756183ee075c8dd4d2b4f4 Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Sun, 29 Nov 2020 19:15:43 +0300 Subject: [PATCH] mhd_send: always call post_cork_setsockopt() after send() --- src/microhttpd/mhd_send.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 764fd82d..3b9bc4d9 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c @@ -432,8 +432,8 @@ MHD_send_on_connection_ (struct MHD_Connection *connection, else if (buffer_size > (size_t) ret) connection->epoll_state &= ~MHD_EPOLL_STATE_WRITE_READY; #endif /* EPOLL_SUPPORT */ - if (buffer_size == (size_t) ret) - post_cork_setsockopt (connection, want_cork); + post_cork_setsockopt (connection, + want_cork ? (buffer_size == (size_t) ret) : false); } return ret;