aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_send.c
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 /src/microhttpd/mhd_send.c
parente099a6ea0a9731d888388d5cc716be02057f4c25 (diff)
downloadlibmicrohttpd-da7cb682a24915a4bc37faf2c76583996fe26aea.tar.gz
libmicrohttpd-da7cb682a24915a4bc37faf2c76583996fe26aea.zip
swap _NODELAY and _NOPUSH
Diffstat (limited to 'src/microhttpd/mhd_send.c')
-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,
71 (const void *) &on_val, 71 (const void *) &on_val,
72 sizeof (on_val)); 72 sizeof (on_val));
73 } 73 }
74#elif TCP_NODELAY
75 {
76 const MHD_SCKT_OPT_BOOL_ off_val = 0;
77 const MHD_SCKT_OPT_BOOL_ on_val = 1;
78
79 ret = setsockopt (connection->socket_fd,
80 IPPROTO_TCP,
81 TCP_NODELAY,
82 (const void *) want_cork ? &off_val : &on_val,
83 sizeof (on_val));
84 }
85#elif TCP_NOPUSH 74#elif TCP_NOPUSH
86 if (want_cork) 75 if (want_cork)
87 { 76 {
@@ -104,6 +93,17 @@ pre_cork_setsockopt (struct MHD_Connection *connection,
104 (const void *) &on_val, 93 (const void *) &on_val,
105 sizeof (on_val)); 94 sizeof (on_val));
106 } 95 }
96#elif TCP_NODELAY
97 {
98 const MHD_SCKT_OPT_BOOL_ off_val = 0;
99 const MHD_SCKT_OPT_BOOL_ on_val = 1;
100
101 ret = setsockopt (connection->socket_fd,
102 IPPROTO_TCP,
103 TCP_NODELAY,
104 (const void *) want_cork ? &off_val : &on_val,
105 sizeof (on_val));
106 }
107#endif 107#endif
108 if (0 == ret) 108 if (0 == ret)
109 { 109 {
@@ -171,8 +171,6 @@ post_cork_setsockopt (struct MHD_Connection *connection,
171 &off_val, 171 &off_val,
172 sizeof (off_val)); 172 sizeof (off_val));
173 } 173 }
174#elif TCP_NODELAY
175 /* nothing to do */
176#elif TCP_NOPUSH 174#elif TCP_NOPUSH
177 if (! want_cork) 175 if (! want_cork)
178 { 176 {
@@ -184,6 +182,8 @@ post_cork_setsockopt (struct MHD_Connection *connection,
184 (const void *) &off_val, 182 (const void *) &off_val,
185 sizeof (off_val)); 183 sizeof (off_val));
186 } 184 }
185#elif TCP_NODELAY
186 /* nothing to do */
187#endif 187#endif
188 if (0 == ret) 188 if (0 == ret)
189 { 189 {