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.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 186e9dd2..e6a26efc 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -681,8 +681,7 @@ try_ready_normal_body (struct MHD_Connection *connection)
681 connection->response_write_position) ) 681 connection->response_write_position) )
682 return MHD_YES; /* response already ready */ 682 return MHD_YES; /* response already ready */
683#if LINUX 683#if LINUX
684 if ( (MHD_INVALID_SOCKET != response->fd) && 684 if (MHD_resp_sender_sendfile == connection->resp_sender)
685 (0 == (connection->daemon->options & MHD_USE_TLS)) )
686 { 685 {
687 /* will use sendfile, no need to bother response crc */ 686 /* will use sendfile, no need to bother response crc */
688 return MHD_YES; 687 return MHD_YES;
@@ -3488,6 +3487,14 @@ MHD_queue_response (struct MHD_Connection *connection,
3488 MHD_increment_response_rc (response); 3487 MHD_increment_response_rc (response);
3489 connection->response = response; 3488 connection->response = response;
3490 connection->responseCode = status_code; 3489 connection->responseCode = status_code;
3490#if LINUX
3491 if ( (response->fd == -1) ||
3492 (0 != (connection->daemon->options & MHD_USE_TLS)) )
3493 connection->resp_sender = MHD_resp_sender_std;
3494 else
3495 connection->resp_sender = MHD_resp_sender_sendfile;
3496#endif /* LINUX */
3497
3491 if ( ( (NULL != connection->method) && 3498 if ( ( (NULL != connection->method) &&
3492 (MHD_str_equal_caseless_ (connection->method, 3499 (MHD_str_equal_caseless_ (connection->method,
3493 MHD_HTTP_METHOD_HEAD)) ) || 3500 MHD_HTTP_METHOD_HEAD)) ) ||