[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 85/154: pre_cork socket..
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 85/154: pre_cork socket.. |
Date: |
Mon, 19 Aug 2019 10:16:37 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit c2915ac74083f5803d7d26de83b65eac4cb341a7
Author: ng0 <address@hidden>
AuthorDate: Thu Jul 25 16:11:18 2019 +0000
pre_cork socket..
---
src/microhttpd/mhd_send.c | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 74735cbe..b22313df 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -87,12 +87,11 @@ post_cork_setsockopt (struct MHD_Connection *connection,
int
pre_cork_setsockopt (struct MHD_Connection *connection,
- bool want_cork,
- bool val)
+ bool want_cork)
{
int ret;
bool using_tls = false;
- const MHD_SCKT_OPT_BOOL_ state_val = val ? 1 : 0;
+ // const MHD_SCKT_OPT_BOOL_ state_val = val ? 1 : 0;
const MHD_SCKT_OPT_BOOL_ off_val = 0;
const MHD_SCKT_OPT_BOOL_ on_val = 1;
#ifdef HTTPS_SUPPORT
@@ -107,7 +106,7 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
}
// if sk_tcp_nodelay_on is already what we pass in, return.
- if (connection->sk_tcp_nodelay_on == val)
+ if (connection->sk_tcp_nodelay_on == want_cork)
{
return 0; // return type error
}
@@ -133,10 +132,16 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
#else
ret = -1;
#endif
+
if (0 == ret)
{
- connection->sk_tcp_nodelay_on = val;
+#if TCP_CORK || TCP_NODELAY
+ connection->sk_tcp_nodelay_on = true;
+#elif TCP_NOPUSH
+ connection->sk_tcp_nodelay_on = false;
+#endif
}
+ return ret;
}
/**
@@ -404,11 +409,14 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
using_tls = (0 != (connection->daemon->options & MHD_USE_TLS));
#endif
+ pre_cork_setsockopt (connection, want_cork);
+
+ /*
#if TCP_CORK
- /* When we have CORK, we can have NODELAY on the same system,
- * at least since Linux 2.2 and both can be combined since
- * Linux 2.5.71. For more details refer to tcp(7) on Linux.
- * No other system in 2019-06 has TCP_CORK. */
+ // When we have CORK, we can have NODELAY on the same system,
+ // at least since Linux 2.2 and both can be combined since
+ // Linux 2.5.71. For more details refer to tcp(7) on Linux.
+ // No other system in 2019-06 has TCP_CORK.
if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
{
MHD_send_socket_state_cork_nodelay_ (connection,
@@ -418,9 +426,9 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
true);
}
#elif TCP_NOPUSH
- /* TCP_NOPUSH on FreeBSD is equal to cork on Linux, with the
- * exception that we know that TCP_NOPUSH will definitely
- * exist and we can disregard TCP_NODELAY unless requested. */
+ // TCP_NOPUSH on FreeBSD is equal to cork on Linux, with the
+ // exception that we know that TCP_NOPUSH will definitely
+ // exist and we can disregard TCP_NODELAY unless requested.
if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
{
MHD_send_socket_state_nopush_ (connection, true, false);
@@ -432,7 +440,7 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
MHD_setsockopt_ (connection, TCP_NODELAY, false, false);
}
#endif
-
+ */
#ifdef HTTPS_SUPPORT
if (using_tls)
{
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 50/154: do use MSG_NOSIGNAL in send() if available, (continued)
- [GNUnet-SVN] [libmicrohttpd] 50/154: do use MSG_NOSIGNAL in send() if available, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 47/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 42/154: indent, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 54/154: Merge branch 'dev/ng0/gsoc2019' of git+ssh://gnunet.org/libmicrohttpd into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 51/154: gnutls cork integration, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 61/154: incomplete commit, adding 2 new helper functions and more., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 69/154: function replace., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 79/154: fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 82/154: revert last patch, should be only on master for now, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 67/154: remove commented code, replaced by functions., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 85/154: pre_cork socket..,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 72/154: first attempt to add MHD_send_on_connection2_, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 66/154: doxygen., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 70/154: conditionally return and setsockopt., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 74/154: fix failure to build., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 73/154: Start reworking into generic setsockopt wrapper., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 84/154: Merge branch 'dev/ng0/gsoc2019' of gnunet.org:libmicrohttpd into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 77/154: fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 78/154: buffersize, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 90/154: show not tell, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 81/154: Merge branch 'dev/ng0/gsoc2019' of git+ssh://gnunet.org/libmicrohttpd into dev/ng0/gsoc2019, gnunet, 2019/08/19