diff options
author | ng0 <ng0@n0.is> | 2019-07-25 17:51:43 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-07-25 17:51:43 +0000 |
commit | 78d30bd5827eeaffdfb5906a4afedb48868aceac (patch) | |
tree | ed9cbdf74ba13bcbab0195ef9d554e49f9bc67aa | |
parent | 9ec1b5df5e488ab1ab06dec156f1868fd32478f5 (diff) | |
download | libmicrohttpd-78d30bd5827eeaffdfb5906a4afedb48868aceac.tar.gz libmicrohttpd-78d30bd5827eeaffdfb5906a4afedb48868aceac.zip |
attempt fix
-rw-r--r-- | src/microhttpd/mhd_send.c | 26 | ||||
-rw-r--r-- | src/microhttpd/mhd_send.h | 2 |
2 files changed, 1 insertions, 27 deletions
diff --git a/src/microhttpd/mhd_send.c b/src/microhttpd/mhd_send.c index 354b9349..284def22 100644 --- a/src/microhttpd/mhd_send.c +++ b/src/microhttpd/mhd_send.c | |||
@@ -678,31 +678,7 @@ static int freebsd_sendfile_flags_; | |||
678 | */ | 678 | */ |
679 | static int freebsd_sendfile_flags_thd_p_c_; | 679 | static int freebsd_sendfile_flags_thd_p_c_; |
680 | #endif /* SF_FLAGS */ | 680 | #endif /* SF_FLAGS */ |
681 | /** | 681 | |
682 | * Initialises static variables | ||
683 | */ | ||
684 | void | ||
685 | MHD_conn_init_static_ (void) | ||
686 | { | ||
687 | /* FreeBSD 11 and later allow to specify read-ahead size | ||
688 | * and handles SF_NODISKIO differently. | ||
689 | * SF_FLAGS defined only on FreeBSD 11 and later. */ | ||
690 | #ifdef SF_FLAGS | ||
691 | long sys_page_size = sysconf (_SC_PAGESIZE); | ||
692 | if (0 > sys_page_size) | ||
693 | { /* Failed to get page size. */ | ||
694 | freebsd_sendfile_flags_ = SF_NODISKIO; | ||
695 | freebsd_sendfile_flags_thd_p_c_ = SF_NODISKIO; | ||
696 | } | ||
697 | else | ||
698 | { | ||
699 | freebsd_sendfile_flags_ = | ||
700 | SF_FLAGS((uint16_t)(MHD_SENFILE_CHUNK_ / sys_page_size), SF_NODISKIO); | ||
701 | freebsd_sendfile_flags_thd_p_c_ = | ||
702 | SF_FLAGS((uint16_t)(MHD_SENFILE_CHUNK_THR_P_C_ / sys_page_size), SF_NODISKIO); | ||
703 | } | ||
704 | #endif /* SF_FLAGS */ | ||
705 | } | ||
706 | #endif /* HAVE_FREEBSD_SENDFILE */ | 682 | #endif /* HAVE_FREEBSD_SENDFILE */ |
707 | 683 | ||
708 | #if defined(_MHD_HAVE_SENDFILE) | 684 | #if defined(_MHD_HAVE_SENDFILE) |
diff --git a/src/microhttpd/mhd_send.h b/src/microhttpd/mhd_send.h index 4974adcd..e94ed509 100644 --- a/src/microhttpd/mhd_send.h +++ b/src/microhttpd/mhd_send.h | |||
@@ -119,6 +119,4 @@ ssize_t | |||
119 | sendfile_adapter (struct MHD_Connection *connection); | 119 | sendfile_adapter (struct MHD_Connection *connection); |
120 | #endif | 120 | #endif |
121 | 121 | ||
122 | void | ||
123 | MHD_conn_init_static_ (void); | ||
124 | #endif /* MHD_SEND_H */ | 122 | #endif /* MHD_SEND_H */ |