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.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 2511230d..a7ad7220 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -36,9 +36,9 @@
36#include "mhd_sockets.h" 36#include "mhd_sockets.h"
37#include "mhd_compat.h" 37#include "mhd_compat.h"
38#include "mhd_itc.h" 38#include "mhd_itc.h"
39#ifdef __linux__ 39#ifdef HAVE_LINUX_SENDFILE
40#include <sys/sendfile.h> 40#include <sys/sendfile.h>
41#endif 41#endif /* HAVE_LINUX_SENDFILE */
42#ifdef HTTPS_SUPPORT 42#ifdef HTTPS_SUPPORT
43#include "connection_https.h" 43#include "connection_https.h"
44#endif /* HTTPS_SUPPORT */ 44#endif /* HTTPS_SUPPORT */
@@ -219,7 +219,7 @@ send_param_adapter (struct MHD_Connection *connection,
219} 219}
220 220
221 221
222#ifdef __linux__ 222#ifdef HAVE_LINUX_SENDFILE
223/** 223/**
224 * Function for sending responses backed by file FD. 224 * Function for sending responses backed by file FD.
225 * 225 *
@@ -303,7 +303,7 @@ sendfile_adapter (struct MHD_Connection *connection)
303#endif /* EPOLL_SUPPORT */ 303#endif /* EPOLL_SUPPORT */
304 return ret; 304 return ret;
305} 305}
306#endif /* __linux__ */ 306#endif /* HAVE_LINUX_SENDFILE */
307 307
308 308
309/** 309/**
@@ -935,7 +935,7 @@ try_ready_normal_body (struct MHD_Connection *connection)
935 (response->data_size + response->data_start > 935 (response->data_size + response->data_start >
936 connection->response_write_position) ) 936 connection->response_write_position) )
937 return MHD_YES; /* response already ready */ 937 return MHD_YES; /* response already ready */
938#if LINUX 938#if defined(HAVE_LINUX_SENDFILE)
939 if (MHD_resp_sender_sendfile == connection->resp_sender) 939 if (MHD_resp_sender_sendfile == connection->resp_sender)
940 { 940 {
941 /* will use sendfile, no need to bother response crc */ 941 /* will use sendfile, no need to bother response crc */
@@ -2877,15 +2877,15 @@ MHD_connection_handle_write (struct MHD_Connection *connection)
2877 /* mutex was already unlocked by try_ready_normal_body */ 2877 /* mutex was already unlocked by try_ready_normal_body */
2878 return; 2878 return;
2879 } 2879 }
2880#ifdef __linux__ 2880#if defined(HAVE_LINUX_SENDFILE)
2881 if (MHD_resp_sender_sendfile == connection->resp_sender) 2881 if (MHD_resp_sender_sendfile == connection->resp_sender)
2882 { 2882 {
2883 ret = sendfile_adapter (connection); 2883 ret = sendfile_adapter (connection);
2884 } 2884 }
2885 else 2885 else
2886#else /* ! __linux__ */ 2886#else /* ! HAVE_LINUX_SENDFILE */
2887 if (1) 2887 if (1)
2888#endif /* ! __linux__ */ 2888#endif /* ! HAVE_LINUX_SENDFILE */
2889 { 2889 {
2890 data_write_offset = connection->response_write_position 2890 data_write_offset = connection->response_write_position
2891 - response->data_start; 2891 - response->data_start;
@@ -3821,13 +3821,13 @@ MHD_queue_response (struct MHD_Connection *connection,
3821 MHD_increment_response_rc (response); 3821 MHD_increment_response_rc (response);
3822 connection->response = response; 3822 connection->response = response;
3823 connection->responseCode = status_code; 3823 connection->responseCode = status_code;
3824#if LINUX 3824#if defined(HAVE_LINUX_SENDFILE)
3825 if ( (response->fd == -1) || 3825 if ( (response->fd == -1) ||
3826 (0 != (connection->daemon->options & MHD_USE_TLS)) ) 3826 (0 != (connection->daemon->options & MHD_USE_TLS)) )
3827 connection->resp_sender = MHD_resp_sender_std; 3827 connection->resp_sender = MHD_resp_sender_std;
3828 else 3828 else
3829 connection->resp_sender = MHD_resp_sender_sendfile; 3829 connection->resp_sender = MHD_resp_sender_sendfile;
3830#endif /* LINUX */ 3830#endif /* HAVE_LINUX_SENDFILE */
3831 3831
3832 if ( ( (NULL != connection->method) && 3832 if ( ( (NULL != connection->method) &&
3833 (MHD_str_equal_caseless_ (connection->method, 3833 (MHD_str_equal_caseless_ (connection->method,