[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libmicrohttpd] 03/06: mhd_send: fixed compatibility with platforms with
From: |
gnunet |
Subject: |
[libmicrohttpd] 03/06: mhd_send: fixed compatibility with platforms without TCP_CORK and TCP_NOPUSH |
Date: |
Tue, 01 Dec 2020 17:12:37 +0100 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit 8435c616da188dbb0608774503506fc70c579d5d
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sun Nov 29 23:04:24 2020 +0300
mhd_send: fixed compatibility with platforms without TCP_CORK and TCP_NOPUSH
TCP_NODELAY must be turned of *before* send()
otherwise it doesn't push buffered data.
---
src/microhttpd/mhd_send.c | 23 +++++------------------
1 file changed, 5 insertions(+), 18 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index f55f70fa..4dedec14 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -186,18 +186,17 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
break;
}
#else
- /* CORK/NOPUSH/MSG_MORE do not exist on this platform,
- so we must toggle Naggle's algorithm on/off instead
+ /* CORK/NOPUSH do not exist on this platform,
+ Turning on/off of Naggle's algorithm
(otherwise we keep it always off) */
if (connection->sk_cork_on == want_cork)
{
/* nothing to do, success! */
return;
}
- if ( (want_cork) &&
- (0 == MHD_socket_set_nodelay_ (connection->socket_fd,
- false)) )
- connection->sk_cork_on = true;
+ if (0 == MHD_socket_set_nodelay_ (connection->socket_fd,
+ (! want_cork)))
+ connection->sk_cork_on = want_cork;
#endif
}
@@ -284,18 +283,6 @@ post_cork_setsockopt (struct MHD_Connection *connection,
break;
}
#else
- /* CORK/NOPUSH/MSG_MORE do not exist on this platform,
- so we must toggle Naggle's algorithm on/off instead
- (otherwise we keep it always off) */
- if (connection->sk_cork_on == want_cork)
- {
- /* nothing to do, success! */
- return;
- }
- if ( (! want_cork) &&
- (0 == MHD_socket_set_nodelay_ (connection->socket_fd,
- true)) )
- connection->sk_cork_on = false;
#endif
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [libmicrohttpd] branch master updated (7ef7bab3 -> 331bc629), gnunet, 2020/12/01
- [libmicrohttpd] 05/06: mhd_send: fixed for C90 compilers, gnunet, 2020/12/01
- [libmicrohttpd] 03/06: mhd_send: fixed compatibility with platforms without TCP_CORK and TCP_NOPUSH,
gnunet <=
- [libmicrohttpd] 04/06: Removed gnutls_record_(un)cork() usage., gnunet, 2020/12/01
- [libmicrohttpd] 02/06: mhd_send: prepare for removal of gnutls_record_cork() call, gnunet, 2020/12/01
- [libmicrohttpd] 06/06: mhd_send: renamed functions and parameters to reflect the key purpose., gnunet, 2020/12/01
- [libmicrohttpd] 01/06: mhd_send: use MSG_MORE only if it functions, gnunet, 2020/12/01