aboutsummaryrefslogtreecommitdiff
path: root/src/microhttpd/mhd_send.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/microhttpd/mhd_send.c')
-rw-r--r--src/microhttpd/mhd_send.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c
index 987a694b..50fa5483 100644
--- a/src/microhttpd/mhd_send.c
+++ b/src/microhttpd/mhd_send.c
@@ -84,7 +84,7 @@ MHD_send_init_static_vars_ (void)
84 * SF_FLAGS defined only on FreeBSD 11 and later. */ 84 * SF_FLAGS defined only on FreeBSD 11 and later. */
85#ifdef SF_FLAGS 85#ifdef SF_FLAGS
86 long sys_page_size = sysconf (_SC_PAGESIZE); 86 long sys_page_size = sysconf (_SC_PAGESIZE);
87 if (0 > sys_page_size) 87 if (0 >= sys_page_size)
88 { /* Failed to get page size. */ 88 { /* Failed to get page size. */
89 freebsd_sendfile_flags_ = SF_NODISKIO; 89 freebsd_sendfile_flags_ = SF_NODISKIO;
90 freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO; 90 freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO;
@@ -92,10 +92,11 @@ MHD_send_init_static_vars_ (void)
92 else 92 else
93 { 93 {
94 freebsd_sendfile_flags_ = 94 freebsd_sendfile_flags_ =
95 SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_ / sys_page_size), SF_NODISKIO); 95 SF_FLAGS ((uint16_t) ((MHD_SENFILE_CHUNK_ + sys_page_size - 1)
96 / sys_page_size), SF_NODISKIO);
96 freebsd_sendfile_flags_thd_p_c_ = 97 freebsd_sendfile_flags_thd_p_c_ =
97 SF_FLAGS ((uint16_t) (MHD_SENFILE_CHUNK_THR_P_C_ / sys_page_size), 98 SF_FLAGS ((uint16_t) ((MHD_SENFILE_CHUNK_THR_P_C_ + sys_page_size - 1)
98 SF_NODISKIO); 99 / sys_page_size), SF_NODISKIO);
99 } 100 }
100#endif /* SF_FLAGS */ 101#endif /* SF_FLAGS */
101} 102}