[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 128/154: TCP_NOPUSH
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 128/154: TCP_NOPUSH |
Date: |
Mon, 19 Aug 2019 10:17:20 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit e099a6ea0a9731d888388d5cc716be02057f4c25
Author: ng0 <address@hidden>
AuthorDate: Thu Aug 1 17:41:55 2019 +0000
TCP_NOPUSH
---
src/microhttpd/mhd_send.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 87cecfb4..93fabd4f 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -83,10 +83,21 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
sizeof (on_val));
}
#elif TCP_NOPUSH
+ if (want_cork)
{
const MHD_SCKT_OPT_BOOL_ on_val = 1;
+ /* TCP_NOPUSH has the same logic as MSG_MSG_MORE.
+ * The two are more or less equivalent by a source
+ * transformation (ie
+ * send(MSG_MORE) => "set TCP_NOPUSH + send() + clear TCP_NOPUSH".
+ * Both of them are really fairly "local", but TCP_NOPUSH has a
+ * _notion_ of persistency that is entirely lacking in MSG_MORE.
+ * ... with TCP_NOPUSH you basically have to know what your last
+ * write is, and clear the bit _before_ that write if you want
+ * to avoid bad latencies.
+ * https://yarchive.net/comp/linux/sendfile.html A thread from 2001,
+ * take with 18 grains of salt. */
- // FIXME: this must be wrong, set unconditionally irrespective of
'want_cork'!
ret = setsockopt (connection->socket_fd,
IPPROTO_TCP,
TCP_NOPUSH,
@@ -117,8 +128,8 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
break;
case ENOPROTOOPT:
/* FIXME: optlen unknown, should at least log this */
- break;
- default:
+ break;
+ default:
/* any others? man page does not list more... */
break;
}
@@ -163,10 +174,9 @@ post_cork_setsockopt (struct MHD_Connection *connection,
#elif TCP_NODELAY
/* nothing to do */
#elif TCP_NOPUSH
- // FIXME: this must be wrong, set unconditionally irrespective of
'want_cork'!
+ if (! want_cork)
{
const MHD_SCKT_OPT_BOOL_ off_val = 0;
- const MHD_SCKT_OPT_BOOL_ on_val = 1;
ret = setsockopt (connection->socket_fd,
IPPROTO_TCP,
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 118/154: Add MSG_MORE detection., (continued)
- [GNUnet-SVN] [libmicrohttpd] 118/154: Add MSG_MORE detection., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 123/154: fix behavior on NetBSD, use the right sizeof., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 106/154: switch post/pre function definition to a logical appearance in the file (pre before post), purely for orientation., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 110/154: check before post_ function if we need to set want_cork to false, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 96/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 113/154: _len -> _size, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 147/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 149/154: connection.c: remove 2 more calls of dead code., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 122/154: partial fix to sendmsg code, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 134/154: handle TLS case in send_on_connectin2, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 128/154: TCP_NOPUSH,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 141/154: Document MHD_UPGRADE_ACTION_CORK_ON and HD_UPGRADE_ACTION_CORK_OFF., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 145/154: remove more code., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 143/154: fix a couple of fixmes: add log messages., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 137/154: remove obsolete OLD_SOCK if'd blocks., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 142/154: Add draft of Changelog., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 150/154: mhd_send.c: log EINVAL, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 148/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 88/154: attempt fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 71/154: lisp sneeks in., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 75/154: switch functions., gnunet, 2019/08/19