libmicrohttpd

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

commit add9d89d3b3b5be84b35ef85d490a1b2b34bca7f
parent ee7a8f2c540daae0ecd88bdae57ebe268f208794
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Thu, 23 Nov 2017 17:56:55 +0300

Added MHD_FEATURE_SENDFILE test feature

Diffstat:
MChangeLog | 3+++
Msrc/include/microhttpd.h | 9++++++++-
Msrc/microhttpd/daemon.c | 7+++++++
3 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,6 @@ +Thu Nov 23 17:40:00 MSK 2017 + Added MHD_FEATURE_SENDFILE enum value and report. -EG + Thu Nov 23 08:56:00 MSK 2017 Fixed receiving large requests in TLS mode with epoll. Improved GnuTLS and libgcrypt detection in configure, do not ignore diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h @@ -3477,7 +3477,14 @@ enum MHD_FEATURE * If SIGPIPE suppression is not supported, application must handle * SIGPIPE signal by itself. */ - MHD_FEATURE_AUTOSUPPRESS_SIGPIPE = 20 + MHD_FEATURE_AUTOSUPPRESS_SIGPIPE = 20, + + /** + * Get whether MHD use system's sendfile() function to send + * file-FD based responses over non-TLS connections. + * @note Since v0.9.56 + */ + MHD_FEATURE_SENDFILE = 21 }; diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c @@ -6623,6 +6623,13 @@ MHD_is_feature_supported(enum MHD_FEATURE feature) #else return MHD_NO; #endif + case MHD_FEATURE_SENDFILE: +#ifdef _MHD_HAVE_SENDFILE + return MHD_YES; +#else + return MHD_NO; +#endif + } return MHD_NO; }