libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit a1371a29ec0918070dfd243f626f202d5a9a95e1
parent 6c751386a2e06d35b6d072c064bd581ddd561c52
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu, 15 Apr 2021 21:45:02 +0300

init refactoring: always call MHD_send_init_static_vars_()

Diffstat:
Msrc/microhttpd/daemon.c | 2--
Msrc/microhttpd/mhd_send.c | 8+++++---
Msrc/microhttpd/mhd_send.h | 3---
3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -8015,9 +8015,7 @@ MHD_init (void) gnutls_global_init (); #endif /* HTTPS_SUPPORT */ MHD_monotonic_sec_counter_init (); -#ifdef HAVE_FREEBSD_SENDFILE MHD_send_init_static_vars_ (); -#endif /* HAVE_FREEBSD_SENDFILE */ MHD_init_mem_pools_ (); } diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c @@ -82,6 +82,9 @@ static int freebsd_sendfile_flags_; */ static int freebsd_sendfile_flags_thd_p_c_; #endif /* SF_FLAGS */ +#endif /* HAVE_FREEBSD_SENDFILE */ + + /** * Initialises static variables */ @@ -91,6 +94,7 @@ MHD_send_init_static_vars_ (void) /* FreeBSD 11 and later allow to specify read-ahead size * and handles SF_NODISKIO differently. * SF_FLAGS defined only on FreeBSD 11 and later. */ +#ifdef HAVE_FREEBSD_SENDFILE #ifdef SF_FLAGS long sys_page_size = sysconf (_SC_PAGESIZE); if (0 >= sys_page_size) @@ -108,10 +112,8 @@ MHD_send_init_static_vars_ (void) / sys_page_size), SF_NODISKIO); } #endif /* SF_FLAGS */ -} - - #endif /* HAVE_FREEBSD_SENDFILE */ +} bool diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h @@ -46,15 +46,12 @@ #define MHD_VECT_SEND 1 #endif /* HAVE_SENDMSG || HAVE_WRITEV || MHD_WINSOCK_SOCKETS */ -#ifdef HAVE_FREEBSD_SENDFILE /** * Initialises static variables */ void MHD_send_init_static_vars_ (void); -#endif /* HAVE_FREEBSD_SENDFILE */ - /** * Send buffer to the client, push data from network buffer if requested