[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 98/154: simplify
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 98/154: simplify |
Date: |
Mon, 19 Aug 2019 10:16:50 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit d5c3f00f9f96cbf9ed227b1f8c870d5232bb9039
Author: Christian Grothoff <address@hidden>
AuthorDate: Thu Jul 25 20:32:36 2019 +0200
simplify
---
src/microhttpd/mhd_send.c | 62 +++--------------------------------------------
1 file changed, 4 insertions(+), 58 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index fa128fa1..ee627e10 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -598,14 +598,7 @@ static int freebsd_sendfile_flags_thd_p_c_;
ssize_t
sendfile_adapter (struct MHD_Connection *connection)
{
- bool want_cork = false;
- bool have_cork;
- bool have_more;
- bool use_corknopush;
- bool using_tls = false;
-
ssize_t ret;
- ssize_t lo_ret;
const int file_fd = connection->response->fd;
uint64_t left;
uint64_t offsetu64;
@@ -633,6 +626,8 @@ sendfile_adapter (struct MHD_Connection *connection)
size_t send_size = 0;
mhd_assert (MHD_resp_sender_sendfile == connection->resp_sender);
+ (void) pre_cork_setsockopt (connection, false);
+
offsetu64 = connection->response_write_position +
connection->response->fd_off;
left = connection->response->total_size -
connection->response_write_position;
/* Do not allow system to stick sending on single fast connection:
@@ -772,57 +767,8 @@ sendfile_adapter (struct MHD_Connection *connection)
ret = (ssize_t)len;
#endif /* HAVE_FREEBSD_SENDFILE */
- ret = lo_ret;
- if (0 > ret)
- {
- /* ! could be avoided by redefining the variable. */
- have_cork = ! connection->sk_tcp_nodelay_on;
-
-#ifdef MSG_MORE
- have_more = true;
-#else
- have_more = false;
-#endif
-
-#if TCP_NODELAY
- use_corknopush = false;
-#elif TCP_CORK
- use_corknopush = true;
-#elif TCP_NOPUSH
- use_corknopush = true;
-#endif
+ (void) post_cork_setsockopt (connection, false);
-#ifdef HTTPS_SUPPORT
- using_tls = (0 != (connection->daemon->options & MHD_USE_TLS));
-#endif
-
-#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
- return lo_ret;
- }
- else
- {
- return ret;
- }
+ return ret;
}
#endif /* _MHD_HAVE_SENDFILE */
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 102/154: for tests, (continued)
- [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
- [GNUnet-SVN] [libmicrohttpd] 98/154: simplify,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 104/154: skcork, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 124/154: mhd_send commented,, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 127/154: remove commentblock, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 112/154: configure.ac: define a check for HAVE_SENDMSG, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 121/154: MSG_MORE fix, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 115/154: gitignore build-aux., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 132/154: reduce variable scope, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 131/154: toggle Naggle if and only if corking is not possible by other means, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 126/154: fixes, comments, FIXMEs, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 133/154: properly handle return value from send_on_connection2, gnunet, 2019/08/19