[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 05/05: mhd_send: improved setting of sk_cork_on
From: |
gnunet |
Subject: |
[libmicrohttpd] 05/05: mhd_send: improved setting of sk_cork_on |
Date: |
Sun, 29 Nov 2020 19:50:14 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 7ef7bab33db35986d3ced393ce8615f4a7c5a833
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Nov 29 21:44:22 2020 +0300
mhd_send: improved setting of sk_cork_on
sk_cork_on is still incorrect as MSG_MORE do not
manipulate CORK value.
---
src/microhttpd/mhd_send.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index fce83cd5..441f7e7d 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -395,13 +395,14 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
#endif /* HTTPS_SUPPORT */
{
/* plaintext transmission */
+ bool new_cork_state;
+
pre_cork_setsockopt (connection, want_cork);
#if HAVE_MSG_MORE
ret = send (s,
buffer,
buffer_size,
MSG_NOSIGNAL_OR_ZERO | (want_cork ? MSG_MORE : 0));
- connection->sk_cork_on = want_cork; /* pretend corking happened as
requested */
#else
ret = send (connection->socket_fd,
buffer,
@@ -432,8 +433,9 @@ 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 */
- post_cork_setsockopt (connection,
- want_cork ? (buffer_size == (size_t) ret) : false);
+ new_cork_state = want_cork ? (buffer_size == (size_t) ret) : false;
+ post_cork_setsockopt (connection, new_cork_state);
+ connection->sk_cork_on = new_cork_state;
}
return ret;
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (ad8a3e3f -> 7ef7bab3), gnunet, 2020/11/29
- [libmicrohttpd] 01/05: enum MHD_SendSocketOptions: renamed values for clarity. The most important is to push the last peace of response data. Without pushing data, MHD is limited to 5 requests/second (on typical OS) with stay-alive clients., gnunet, 2020/11/29
- [libmicrohttpd] 02/05: mhd_send: always call post_cork_setsockopt() after send(), gnunet, 2020/11/29
- [libmicrohttpd] 04/05: new_connection_prepare_(): fixed: CORK is never on by default, gnunet, 2020/11/29
- [libmicrohttpd] 05/05: mhd_send: improved setting of sk_cork_on,
gnunet <=
- [libmicrohttpd] 03/05: mhd_sockets: renamed macros for clarity, gnunet, 2020/11/29