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.c41
1 files changed, 0 insertions, 41 deletions
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index 5d7f52fb..98e58123 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -125,47 +125,6 @@
125 */ 125 */
126#define MHD_SENFILE_CHUNK_THR_P_C_ (0x200000) 126#define MHD_SENFILE_CHUNK_THR_P_C_ (0x200000)
127 127
128#ifdef HAVE_FREEBSD_SENDFILE
129#ifdef SF_FLAGS
130/**
131 * FreeBSD sendfile() flags
132 */
133static int freebsd_sendfile_flags_;
134
135/**
136 * FreeBSD sendfile() flags for thread-per-connection
137 */
138static int freebsd_sendfile_flags_thd_p_c_;
139#endif /* SF_FLAGS */
140/**
141 * Initialises static variables
142 */
143void
144MHD_conn_init_static_ (void)
145{
146/* FreeBSD 11 and later allow to specify read-ahead size
147 * and handles SF_NODISKIO differently.
148 * SF_FLAGS defined only on FreeBSD 11 and later. */
149#ifdef SF_FLAGS
150 long sys_page_size = sysconf (_SC_PAGESIZE);
151 if (0 > sys_page_size)
152 { /* Failed to get page size. */
153 freebsd_sendfile_flags_ = SF_NODISKIO;
154 freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO;
155 }
156 else
157 {
158 freebsd_sendfile_flags_ =
159 SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_ / sys_page_size), SF_NODISKIO);
160 freebsd_sendfile_flags_thd_p_c_ =
161 SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_THR_P_C_ / sys_page_size),
162 SF_NODISKIO);
163 }
164#endif /* SF_FLAGS */
165}
166
167
168#endif /* HAVE_FREEBSD_SENDFILE */
169/** 128/**
170 * Callback for receiving data from the socket. 129 * Callback for receiving data from the socket.
171 * 130 *