aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_send.c')
-rw-r--r--src/microhttpd/mhd_send.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index c237d469..3810e121 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -165,6 +165,7 @@ MHD_connection_set_nodelay_state_ (struct MHD_Connection *connection,
165 * Set required cork state for connection socket 165 * Set required cork state for connection socket
166 * 166 *
167 * The function automatically updates sk_corked state. 167 * The function automatically updates sk_corked state.
168 *
168 * @param connection the connection to manipulate 169 * @param connection the connection to manipulate
169 * @param cork_state the requested new state of socket 170 * @param cork_state the requested new state of socket
170 * @return true if succeed, false if failed 171 * @return true if succeed, false if failed
@@ -177,6 +178,8 @@ connection_set_cork_state_ (struct MHD_Connection *connection,
177 const MHD_SCKT_OPT_BOOL_ on_val = 1; 178 const MHD_SCKT_OPT_BOOL_ on_val = 1;
178 int err_code; 179 int err_code;
179 180
181 if (connection->is_unix)
182 return true;
180 if (0 == setsockopt (connection->socket_fd, 183 if (0 == setsockopt (connection->socket_fd,
181 IPPROTO_TCP, 184 IPPROTO_TCP,
182 MHD_TCP_CORK_NOPUSH, 185 MHD_TCP_CORK_NOPUSH,
@@ -240,6 +243,8 @@ pre_send_setopt (struct MHD_Connection *connection,
240 * Final piece is indicated by push_data == true. */ 243 * Final piece is indicated by push_data == true. */
241 const bool buffer_data = (! push_data); 244 const bool buffer_data = (! push_data);
242 245
246 if (connection->is_unix)
247 return;
243 /* The goal is to minimise the total number of additional sys-calls 248 /* The goal is to minimise the total number of additional sys-calls
244 * before and after send(). 249 * before and after send().
245 * The following tricky (over-)complicated algorithm typically use zero, 250 * The following tricky (over-)complicated algorithm typically use zero,
@@ -461,14 +466,14 @@ static bool
461zero_send_ (struct MHD_Connection *connection) 466zero_send_ (struct MHD_Connection *connection)
462{ 467{
463 int dummy; 468 int dummy;
469
470 if (connection->is_unix)
471 return;
464 mhd_assert (_MHD_OFF == connection->sk_corked); 472 mhd_assert (_MHD_OFF == connection->sk_corked);
465 mhd_assert (_MHD_ON == connection->sk_nodelay); 473 mhd_assert (_MHD_ON == connection->sk_nodelay);
466
467 dummy = 0; /* Mute compiler and analyzer warnings */ 474 dummy = 0; /* Mute compiler and analyzer warnings */
468
469 if (0 == MHD_send_ (connection->socket_fd, &dummy, 0)) 475 if (0 == MHD_send_ (connection->socket_fd, &dummy, 0))
470 return true; 476 return true;
471
472#ifdef HAVE_MESSAGES 477#ifdef HAVE_MESSAGES
473 MHD_DLOG (connection->daemon, 478 MHD_DLOG (connection->daemon,
474 _ ("Zero-send failed: %s\n"), 479 _ ("Zero-send failed: %s\n"),
@@ -499,6 +504,8 @@ post_send_setopt (struct MHD_Connection *connection,
499 * Final piece is indicated by push_data == true. */ 504 * Final piece is indicated by push_data == true. */
500 const bool buffer_data = (! push_data); 505 const bool buffer_data = (! push_data);
501 506
507 if (connection->is_unix)
508 return;
502 if (buffer_data) 509 if (buffer_data)
503 return; /* Nothing to do after send(). */ 510 return; /* Nothing to do after send(). */
504 511