[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 91/154: show not tell
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 91/154: show not tell |
Date: |
Mon, 19 Aug 2019 10:16:43 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 9ed35bc8df36b4e52d96d404e233bf3a73b2d2b7
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jul 25 20:11:46 2019 +0200
show not tell
---
src/microhttpd/mhd_send.c | 74 ++---------------------------------------------
1 file changed, 2 insertions(+), 72 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index b90cac8b..d680f55b 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -352,9 +352,6 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
enum MHD_SendSocketOptions options)
{
bool want_cork;
- bool have_cork;
- bool have_more;
- bool use_corknopush;
bool using_tls = false;
MHD_socket s = connection->socket_fd;
ssize_t ret;
@@ -397,50 +394,12 @@ MHD_send_on_connection_ (struct MHD_Connection
*connection,
have_more = false;
#endif
-#if TCP_NODELAY
- use_corknopush = false;
-#elif TCP_CORK
- use_corknopush = true;
-#elif TCP_NOPUSH
- use_corknopush = true;
-#endif
-
#ifdef HTTPS_SUPPORT
using_tls = (0 != (connection->daemon->options & MHD_USE_TLS));
#endif
if (! (have_more || using_tls))
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.
- if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
- {
- MHD_send_socket_state_cork_nodelay_ (connection,
- false,
- true,
- true,
- 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.
- if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
- {
- MHD_send_socket_state_nopush_ (connection, true, false);
- }
-#endif
-#if TCP_NODELAY
- if ((! using_tls) && (! use_corknopush) && (! have_cork && want_cork))
- {
- MHD_setsockopt_ (connection, TCP_NODELAY, false, false);
- }
-#endif
- */
#ifdef HTTPS_SUPPORT
if (using_tls)
{
@@ -519,37 +478,8 @@ MHD_send_on_connection_ (struct MHD_Connection *connection,
#endif /* EPOLL_SUPPORT */
}
- post_cork_setsockopt (connection, want_cork);
- /*
-#if TCP_CORK
- if ((! using_tls) && (use_corknopush) && (! have_cork && want_cork && !
have_more))
- {
- MHD_send_socket_state_cork_nodelay_ (connection,
- true,
- false,
- false,
- false);
- }
-#elif TCP_NOPUSH
- // We don't have MSG_MORE. The OS which implement NOPUSH implement
- // it in a similar way to TCP_CORK on Linux. This means we can just
- // disregard the else branch for TCP_NODELAY which we had to use
- // for the TCP_CORK case here.
- // XXX: Verify this statement and finetune if necessary for
- // other systems, as only FreeBSD was checked.
- if ((! using_tls) && (use_corknopush) && (have_cork && ! want_cork))
- {
- MHD_send_socket_state_nopush_ (connection, true, false);
- }
-#endif
-
-#if TCP_NODELAY
- if ((! using_tls) && (! use_corknopush) && (have_cork && ! want_cork))
- {
- MHD_setsockopt_ (connection, TCP_NODELAY, true, true);
- }
-#endif
- */
+ if (! (have_more || using_tls))
+ post_cork_setsockopt (connection, want_cork);
return ret;
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 88/154: attempt fix, (continued)
- [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
- [GNUnet-SVN] [libmicrohttpd] 95/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 68/154: Add MHD_send_socket_state_cork_nodelay_ and use it., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 65/154: remove old function name., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 94/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 89/154: attempt fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 97/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 108/154: have_cork->want_cork, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 91/154: show not tell,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 102/154: for tests, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 86/154: initial move code sendfile., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 100/154: incomplete, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 111/154: synt, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 105/154: remove commented code, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 99/154: remove dead code, comment new code., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 109/154: declare ret, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 120/154: configure, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 119/154: attempt configure fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 116/154: ack other authors, gnunet, 2019/08/19