[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 37/154: flatten if statements, add initial
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 37/154: flatten if statements, add initial TCP_NOPUSH to MHD_send_on_connection2_ |
Date: |
Mon, 19 Aug 2019 10:15:49 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit 5c197db398d6926dfb378bb4b4dbcf93566e9c1f
Author: ng0 <address@hidden>
AuthorDate: Sun Jul 21 11:08:58 2019 +0000
flatten if statements, add initial TCP_NOPUSH to MHD_send_on_connection2_
---
src/microhttpd/mhd_send.c | 34 +++++++++++++++++++++++++++-------
1 file changed, 27 insertions(+), 7 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 8ff9b459..dc2c8d69 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -345,19 +345,17 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
#endif
#if TCP_NODELAY
- if (! use_corknopush)
- {
- if (! have_cork && want_cork)
+ if ((! use_corknopush) && (! have_cork && want_cork))
{
if (0 == setsockopt (s,
IPPROTO_TCP,
TCP_NODELAY,
(const void *) &off_val,
- sizeof (off_val))) {
- connection->sk_tcp_nodelay = false;
- }
+ sizeof (off_val)))
+ {
+ connection->sk_tcp_nodelay = false;
+ }
}
- }
#endif
vector[0].iov_base = header;
@@ -367,6 +365,7 @@ MHD_send_on_connection2_ (struct MHD_Connection *connection,
iovcnt = sizeof (vector) / sizeof (struct iovec);
ret = writev (connection->socket_fd, vector, iovcnt);
#if TCP_CORK
+ if (use_corknopush)
{
eno;
@@ -384,6 +383,27 @@ MHD_send_on_connection2_ (struct MHD_Connection
*connection,
}
return ret;
#endif
+
+#if TCP_NOPUSH
+ if (use_corknopush)
+ {
+ eno;
+
+ eno = errno;
+ if (ret == header_len + buffer_len)
+ {
+ /* Response complete, set NOPUSH to off */
+ setsockopt (s,
+ IPPROTO_TCP,
+ TCP_NOPUSH,
+ (const void *) &off_val,
+ sizeof (off_val));
+ }
+ errno = eno;
+ }
+ return ret;
+#endif
+
#else
return MHD_send_on_connection_ (connection,
header,
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 09/154: startingpoint, (continued)
- [GNUnet-SVN] [libmicrohttpd] 09/154: startingpoint, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 14/154: mhd_send.c: Try to guess the right branch to close., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 17/154: mhd_send: start adding logic from send_param_adapter., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 12/154: Add mhd_send to Makefile, more fixes in mhd_send., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 20/154: mhd_send.c: variable declarations (style)., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 19/154: adjust, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 11/154: restructure a bit to reuse existing send function, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 23/154: mhd_send: change send_tls_adapter() to non-static and export its prototype, use it in mhd_send.c, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 22/154: mhd_send.c: call send_tls_adapter() when TLS is used., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 24/154: move TLS branch to right position, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 37/154: flatten if statements, add initial TCP_NOPUSH to MHD_send_on_connection2_,
gnunet <=
- [GNUnet-SVN] [libmicrohttpd] 39/154: indent, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 33/154: replace connection->send_cls(), gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 13/154: mhd_send.c: fix compiler error about MSG_MORE when MSG_MORE is undefined., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 18/154: more from connection.c, without checks so far., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 16/154: mhd_send: Use MHD_SCKT_OPT_BOOL_ for setsockopt optval., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 28/154: fixes, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 43/154: move comment above function., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 25/154: inline TLS logic, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 15/154: iAdd headerfile for mhd_send., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 26/154: indentation, comments, issue, gnunet, 2019/08/19