summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-08-01 18:07:05 +0000
committerng0 <ng0@n0.is>2019-08-01 18:07:05 +0000
commitda7cb682a24915a4bc37faf2c76583996fe26aea (patch)
treed554b9a2c42804ebe50c30ce83c25d0fd9ee2424
parente099a6ea0a9731d888388d5cc716be02057f4c25 (diff)
swap _NODELAY and _NOPUSH
-rw-r--r--src/microhttpd/mhd_send.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 93fabd4f..7ca2b506 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -71,17 +71,6 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
(const void *) &on_val,
sizeof (on_val));
}
-#elif TCP_NODELAY
- {
- const MHD_SCKT_OPT_BOOL_ off_val = 0;
- const MHD_SCKT_OPT_BOOL_ on_val = 1;
-
- ret = setsockopt (connection->socket_fd,
- IPPROTO_TCP,
- TCP_NODELAY,
- (const void *) want_cork ? &off_val : &on_val,
- sizeof (on_val));
- }
#elif TCP_NOPUSH
if (want_cork)
{
@@ -104,6 +93,17 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
(const void *) &on_val,
sizeof (on_val));
}
+#elif TCP_NODELAY
+ {
+ const MHD_SCKT_OPT_BOOL_ off_val = 0;
+ const MHD_SCKT_OPT_BOOL_ on_val = 1;
+
+ ret = setsockopt (connection->socket_fd,
+ IPPROTO_TCP,
+ TCP_NODELAY,
+ (const void *) want_cork ? &off_val : &on_val,
+ sizeof (on_val));
+ }
#endif
if (0 == ret)
{
@@ -171,8 +171,6 @@ post_cork_setsockopt (struct MHD_Connection *connection,
&off_val,
sizeof (off_val));
}
-#elif TCP_NODELAY
- /* nothing to do */
#elif TCP_NOPUSH
if (! want_cork)
{
@@ -184,6 +182,8 @@ post_cork_setsockopt (struct MHD_Connection *connection,
(const void *) &off_val,
sizeof (off_val));
}
+#elif TCP_NODELAY
+ /* nothing to do */
#endif
if (0 == ret)
{