[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 106/154: switch post/pre function definitio
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 106/154: switch post/pre function definition to a logical appearance in the file (pre before post), purely for orientation. |
Date: |
Mon, 19 Aug 2019 10:16:58 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository libmicrohttpd.
commit be86a916eb5e23d3d636f79e1a95a71f86d7610d
Author: ng0 <address@hidden>
AuthorDate: Mon Jul 29 15:10:37 2019 +0000
switch post/pre function definition to a logical appearance in the file
(pre before post), purely for orientation.
---
src/microhttpd/mhd_send.c | 48 +++++++++++++++++++++++------------------------
1 file changed, 24 insertions(+), 24 deletions(-)
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index be136c23..442a5373 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -43,8 +43,8 @@
* @param want_cork cork state, boolean
*/
static void
-post_cork_setsockopt (struct MHD_Connection *connection,
- bool want_cork)
+pre_cork_setsockopt (struct MHD_Connection *connection,
+ bool want_cork)
{
#ifndef MSG_MORE
int ret;
@@ -57,29 +57,35 @@ post_cork_setsockopt (struct MHD_Connection *connection,
/* nothing to do, success! */
return;
}
+
ret = -1;
#if TCP_CORK
- if (! want_cork)
+ if (want_cork)
ret = setsockopt (connection->socket_fd,
IPPROTO_TCP,
TCP_CORK,
- &off_val,
- sizeof (off_val));
+ (const void *) &on_val,
+ sizeof (on_val));
#elif TCP_NODELAY
- /* nothing to do */
+ ret = setsockopt (connection->socket_fd,
+ IPPROTO_TCP,
+ TCP_NODELAY,
+ (const void *) want_cork ? &off_val : &on_val,
+ sizeof (on_val));
#elif TCP_NOPUSH
ret = setsockopt (connection->socket_fd,
IPPROTO_TCP,
TCP_NOPUSH,
- (const void *) &off_val,
- sizeof (off_val));
+ (const void *) &on_val,
+ sizeof (on_val));
#endif
+
if (0 == ret)
{
connection->sk_cork_on = want_cork;
}
return;
-#endif /* HAVE_MORE */
+#endif /* MSG_MORE */
}
/**
@@ -89,8 +95,8 @@ post_cork_setsockopt (struct MHD_Connection *connection,
* @param want_cork cork state, boolean
*/
static void
-pre_cork_setsockopt (struct MHD_Connection *connection,
- bool want_cork)
+post_cork_setsockopt (struct MHD_Connection *connection,
+ bool want_cork)
{
#ifndef MSG_MORE
int ret;
@@ -103,35 +109,29 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
/* nothing to do, success! */
return;
}
-
ret = -1;
#if TCP_CORK
- if (want_cork)
+ if (! want_cork)
ret = setsockopt (connection->socket_fd,
IPPROTO_TCP,
TCP_CORK,
- (const void *) &on_val,
- sizeof (on_val));
+ &off_val,
+ sizeof (off_val));
#elif TCP_NODELAY
- ret = setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) want_cork ? &off_val : &on_val,
- sizeof (on_val));
+ /* nothing to do */
#elif TCP_NOPUSH
ret = setsockopt (connection->socket_fd,
IPPROTO_TCP,
TCP_NOPUSH,
- (const void *) &on_val,
- sizeof (on_val));
+ (const void *) &off_val,
+ sizeof (off_val));
#endif
-
if (0 == ret)
{
connection->sk_cork_on = want_cork;
}
return;
-#endif /* MSG_MORE */
+#endif /* HAVE_MORE */
}
/**
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [GNUnet-SVN] [libmicrohttpd] 93/154: simplify, (continued)
- [GNUnet-SVN] [libmicrohttpd] 93/154: simplify, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 107/154: test for MGS_MORE existing, not its non-existince., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 76/154: indent, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 101/154: don't cast, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 87/154: remove code, add prototype to mhd_send.h, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 117/154: ., gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 125/154: Merge remote-tracking branch 'origin/master' into dev/ng0/gsoc2019, gnunet, 2019/08/19
- [GNUnet-SVN] [libmicrohttpd] 129/154: swap _NODELAY and _NOPUSH, gnunet, 2019/08/19
- [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 <=
- [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, 2019/08/19
- [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