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.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 901cac0e..11c7099a 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -284,66 +284,6 @@ send_param_adapter (struct MHD_Connection *connection,
284 284
285 285
286/** 286/**
287 * Check whether is possible to force push socket buffer content as
288 * partial packet.
289 * MHD use different buffering logic depending on whether flushing of
290 * socket buffer is possible or not.
291 * If flushing IS possible than MHD activates extra buffering before
292 * sending data to prevent sending partial packets and flush pending
293 * data in socket buffer to push last partial packet to client after
294 * sending logical completed part of data (for example: after sending
295 * full response header or full response message).
296 * If flushing IS NOT possible than MHD activates no buffering (no
297 * delay sending) when it going to send formed fully completed logical
298 * part of data and activate normal buffering after sending.
299 * For idled keep-alive connection MHD always activate normal
300 * buffering.
301 *
302 * @param connection connection to check
303 * @return true if force push is possible, false otherwise
304 */
305_MHD_static_inline bool
306socket_flush_possible (struct MHD_Connection *connection)
307{
308 (void) connection; /* Mute compiler warning. */
309#if defined(TCP_CORK) || defined(TCP_PUSH)
310 return true;
311#else /* !TCP_CORK && !TCP_PUSH */
312 return false;
313#endif /* !TCP_CORK && !TCP_PUSH */
314}
315
316
317/**
318 * Activate no buffering mode (no delay sending) on connection socket
319 * and push to client data pending in socket buffer.
320 *
321 * @param connection connection to be processed
322 * @return true on success, false otherwise
323 */
324_MHD_static_inline bool
325socket_start_no_buffering_flush (struct MHD_Connection *connection)
326{
327 bool res = false;
328#if defined(TCP_NOPUSH) && ! defined(TCP_CORK)
329 const int dummy = 0;
330#endif /* !TCP_CORK */
331
332#if defined(__FreeBSD__) && __FreeBSD__ + 0 >= 9
333 /* FreeBSD do not need zero-send for flushing starting from version 9 */
334#elif defined(TCP_NOPUSH) && ! defined(TCP_CORK)
335 /* Force flush data with zero send otherwise Darwin and some BSD systems
336 will add 5 seconds delay. Not required with TCP_CORK as switching off
337 TCP_CORK always flushes socket buffer. */
338 res = (0 <= MHD_send_ (connection->socket_fd,
339 &dummy,
340 0)) && res;
341#endif /* TCP_NOPUSH && !TCP_CORK*/
342 return res;
343}
344
345
346/**
347 * Get all of the headers from the request. 287 * Get all of the headers from the request.
348 * 288 *
349 * @param connection connection to get values from 289 * @param connection connection to get values from
@@ -3593,9 +3533,6 @@ MHD_connection_handle_idle (struct MHD_Connection *connection)
3593 break; 3533 break;
3594 case MHD_CONNECTION_HEADERS_SENT: 3534 case MHD_CONNECTION_HEADERS_SENT:
3595 /* Some clients may take some actions right after header receive */ 3535 /* Some clients may take some actions right after header receive */
3596 if (socket_flush_possible (connection))
3597 socket_start_no_buffering_flush (connection); /* REMOVE: Dead */
3598
3599#ifdef UPGRADE_SUPPORT 3536#ifdef UPGRADE_SUPPORT
3600 if (NULL != connection->response->upgrade_handler) 3537 if (NULL != connection->response->upgrade_handler)
3601 { 3538 {