aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/connection.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/connection.c')
-rw-r--r--src/microhttpd/connection.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 8fadc8d8..b30c6d1b 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -322,6 +322,7 @@ sendfile_adapter (struct MHD_Connection *connection)
322static int 322static int
323socket_flush_possible(struct MHD_Connection *connection) 323socket_flush_possible(struct MHD_Connection *connection)
324{ 324{
325 (void)connection; /* Mute compiler warning. */
325#if defined(TCP_CORK) || defined(TCP_PUSH) 326#if defined(TCP_CORK) || defined(TCP_PUSH)
326 return MHD_YES; 327 return MHD_YES;
327#else /* !TCP_CORK && !TCP_PUSH */ 328#else /* !TCP_CORK && !TCP_PUSH */
@@ -341,13 +342,13 @@ static int
341socket_start_extra_buffering (struct MHD_Connection *connection) 342socket_start_extra_buffering (struct MHD_Connection *connection)
342{ 343{
343 int res = MHD_NO; 344 int res = MHD_NO;
345 (void)connection; /* Mute compiler warning. */
344#if defined(TCP_CORK) || defined(TCP_NOPUSH) 346#if defined(TCP_CORK) || defined(TCP_NOPUSH)
345 const MHD_SCKT_OPT_BOOL_ on_val = 1; 347 const MHD_SCKT_OPT_BOOL_ on_val = 1;
346#if defined(TCP_NODELAY) 348#if defined(TCP_NODELAY)
347 const MHD_SCKT_OPT_BOOL_ off_val = 0; 349 const MHD_SCKT_OPT_BOOL_ off_val = 0;
348#endif /* TCP_NODELAY */ 350#endif /* TCP_NODELAY */
349 if (!connection) 351 mhd_assert(NULL != connection);
350 return MHD_NO;
351#if defined(TCP_NOPUSH) && !defined(TCP_CORK) 352#if defined(TCP_NOPUSH) && !defined(TCP_CORK)
352 /* Buffer data before sending */ 353 /* Buffer data before sending */
353 res = (0 == setsockopt (connection->socket_fd, 354 res = (0 == setsockopt (connection->socket_fd,
@@ -406,8 +407,8 @@ socket_start_no_buffering (struct MHD_Connection *connection)
406 const MHD_SCKT_OPT_BOOL_ off_val = 0; 407 const MHD_SCKT_OPT_BOOL_ off_val = 0;
407#endif /* TCP_CORK || TCP_NOPUSH */ 408#endif /* TCP_CORK || TCP_NOPUSH */
408 409
409 if (NULL == connection) 410 (void)connection; /* Mute compiler warning. */
410 return MHD_NO; 411 mhd_assert(NULL != connection);
411#if defined(TCP_CORK) 412#if defined(TCP_CORK)
412 /* Allow partial packets */ 413 /* Allow partial packets */
413 res &= (0 == setsockopt (connection->socket_fd, 414 res &= (0 == setsockopt (connection->socket_fd,
@@ -489,8 +490,7 @@ socket_start_normal_buffering (struct MHD_Connection *connection)
489 MHD_SCKT_OPT_BOOL_ cork_val = 0; 490 MHD_SCKT_OPT_BOOL_ cork_val = 0;
490 socklen_t param_size = sizeof (cork_val); 491 socklen_t param_size = sizeof (cork_val);
491#endif /* TCP_CORK */ 492#endif /* TCP_CORK */
492 if (!connection) 493 mhd_assert(NULL != connection);
493 return MHD_NO;
494#if defined(TCP_CORK) 494#if defined(TCP_CORK)
495 /* Allow partial packets */ 495 /* Allow partial packets */
496 /* Disabling TCP_CORK will flush partial packet even if TCP_CORK wasn't enabled before 496 /* Disabling TCP_CORK will flush partial packet even if TCP_CORK wasn't enabled before
@@ -1070,7 +1070,7 @@ try_ready_chunked_body (struct MHD_Connection *connection)
1070 "%X\r\n", 1070 "%X\r\n",
1071 (unsigned int) ret); 1071 (unsigned int) ret);
1072 mhd_assert(cblen > 0); 1072 mhd_assert(cblen > 0);
1073 mhd_assert(cblen < sizeof(cbuf)); 1073 mhd_assert((size_t)cblen < sizeof(cbuf));
1074 memcpy (&connection->write_buffer[sizeof (cbuf) - cblen], 1074 memcpy (&connection->write_buffer[sizeof (cbuf) - cblen],
1075 cbuf, 1075 cbuf,
1076 cblen); 1076 cblen);