diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-04-15 21:45:02 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-04-16 14:20:46 +0300 |
commit | a1371a29ec0918070dfd243f626f202d5a9a95e1 (patch) | |
tree | a836e2959041688b478516b9cec8d8562d14421b /src | |
parent | 6c751386a2e06d35b6d072c064bd581ddd561c52 (diff) | |
download | libmicrohttpd-a1371a29ec0918070dfd243f626f202d5a9a95e1.tar.gz libmicrohttpd-a1371a29ec0918070dfd243f626f202d5a9a95e1.zip |
init refactoring: always call MHD_send_init_static_vars_()
Diffstat (limited to 'src')
-rw-r--r-- | src/microhttpd/daemon.c | 2 | ||||
-rw-r--r-- | src/microhttpd/mhd_send.c | 8 | ||||
-rw-r--r-- | src/microhttpd/mhd_send.h | 3 |
3 files changed, 5 insertions, 8 deletions
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index d3b9958d..fde1703d 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c | |||
@@ -8015,9 +8015,7 @@ MHD_init (void) | |||
8015 | gnutls_global_init (); | 8015 | gnutls_global_init (); |
8016 | #endif /* HTTPS_SUPPORT */ | 8016 | #endif /* HTTPS_SUPPORT */ |
8017 | MHD_monotonic_sec_counter_init (); | 8017 | MHD_monotonic_sec_counter_init (); |
8018 | #ifdef HAVE_FREEBSD_SENDFILE | ||
8019 | MHD_send_init_static_vars_ (); | 8018 | MHD_send_init_static_vars_ (); |
8020 | #endif /* HAVE_FREEBSD_SENDFILE */ | ||
8021 | MHD_init_mem_pools_ (); | 8019 | MHD_init_mem_pools_ (); |
8022 | } | 8020 | } |
8023 | 8021 | ||
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 3810e121..10c95117 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c | |||
@@ -82,6 +82,9 @@ static int freebsd_sendfile_flags_; | |||
82 | */ | 82 | */ |
83 | static int freebsd_sendfile_flags_thd_p_c_; | 83 | static int freebsd_sendfile_flags_thd_p_c_; |
84 | #endif /* SF_FLAGS */ | 84 | #endif /* SF_FLAGS */ |
85 | #endif /* HAVE_FREEBSD_SENDFILE */ | ||
86 | |||
87 | |||
85 | /** | 88 | /** |
86 | * Initialises static variables | 89 | * Initialises static variables |
87 | */ | 90 | */ |
@@ -91,6 +94,7 @@ MHD_send_init_static_vars_ (void) | |||
91 | /* FreeBSD 11 and later allow to specify read-ahead size | 94 | /* FreeBSD 11 and later allow to specify read-ahead size |
92 | * and handles SF_NODISKIO differently. | 95 | * and handles SF_NODISKIO differently. |
93 | * SF_FLAGS defined only on FreeBSD 11 and later. */ | 96 | * SF_FLAGS defined only on FreeBSD 11 and later. */ |
97 | #ifdef HAVE_FREEBSD_SENDFILE | ||
94 | #ifdef SF_FLAGS | 98 | #ifdef SF_FLAGS |
95 | long sys_page_size = sysconf (_SC_PAGESIZE); | 99 | long sys_page_size = sysconf (_SC_PAGESIZE); |
96 | if (0 >= sys_page_size) | 100 | if (0 >= sys_page_size) |
@@ -108,10 +112,8 @@ MHD_send_init_static_vars_ (void) | |||
108 | / sys_page_size), SF_NODISKIO); | 112 | / sys_page_size), SF_NODISKIO); |
109 | } | 113 | } |
110 | #endif /* SF_FLAGS */ | 114 | #endif /* SF_FLAGS */ |
111 | } | ||
112 | |||
113 | |||
114 | #endif /* HAVE_FREEBSD_SENDFILE */ | 115 | #endif /* HAVE_FREEBSD_SENDFILE */ |
116 | } | ||
115 | 117 | ||
116 | 118 | ||
117 | bool | 119 | bool |
diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h index d4ee8de7..57f6319b 100644 --- a/src/microhttpd/mhd_send.h +++ b/src/microhttpd/mhd_send.h | |||
@@ -46,15 +46,12 @@ | |||
46 | #define MHD_VECT_SEND 1 | 46 | #define MHD_VECT_SEND 1 |
47 | #endif /* HAVE_SENDMSG || HAVE_WRITEV || MHD_WINSOCK_SOCKETS */ | 47 | #endif /* HAVE_SENDMSG || HAVE_WRITEV || MHD_WINSOCK_SOCKETS */ |
48 | 48 | ||
49 | #ifdef HAVE_FREEBSD_SENDFILE | ||
50 | /** | 49 | /** |
51 | * Initialises static variables | 50 | * Initialises static variables |
52 | */ | 51 | */ |
53 | void | 52 | void |
54 | MHD_send_init_static_vars_ (void); | 53 | MHD_send_init_static_vars_ (void); |
55 | 54 | ||
56 | #endif /* HAVE_FREEBSD_SENDFILE */ | ||
57 | |||
58 | 55 | ||
59 | /** | 56 | /** |
60 | * Send buffer to the client, push data from network buffer if requested | 57 | * Send buffer to the client, push data from network buffer if requested |