From 0078559fbc964836b92d78bd0de5312c70cd67fb Mon Sep 17 00:00:00 2001 From: "Evgeny Grin (Karlson2k)" Date: Thu, 13 Jul 2017 19:24:06 +0300 Subject: Added new value MHD_FEATURE_AUTOSUPPRESS_SIGPIPE for MHD_is_feature_supported() --- src/include/microhttpd.h | 11 +++++++++-- src/microhttpd/daemon.c | 6 ++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h index de84e5d7..c5bf9a05 100644 --- a/src/include/microhttpd.h +++ b/src/include/microhttpd.h @@ -126,7 +126,7 @@ typedef intptr_t ssize_t; * Current version of the library. * 0x01093001 = 1.9.30-1. */ -#define MHD_VERSION 0x00095501 +#define MHD_VERSION 0x00095502 /** * MHD-internal return code for "YES". @@ -3452,7 +3452,14 @@ enum MHD_FEATURE * Get whether MHD support automatic detection of bind port number. * @sa #MHD_DAEMON_INFO_BIND_PORT */ - MHD_FEATURE_AUTODETECT_BIND_PORT = 19 + MHD_FEATURE_AUTODETECT_BIND_PORT = 19, + + /** + * Get whether MHD support SIGPIPE suppression. + * If SIGPIPE suppression is not supported, application must handle + * SIGPIPE signal by itself. + */ + MHD_FEATURE_AUTOSUPPRESS_SIGPIPE = 20 }; diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c index 2a662af3..08fb8827 100644 --- a/src/microhttpd/daemon.c +++ b/src/microhttpd/daemon.c @@ -6551,6 +6551,12 @@ MHD_is_feature_supported(enum MHD_FEATURE feature) return MHD_YES; #else return MHD_NO; +#endif + case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE: +#if defined(MHD_WINSOCK_SOCKETS) || defined(MHD_socket_nosignal_) || defined (MSG_NOSIGNAL) + return MHD_YES; +#else + return MHD_NO; #endif } return MHD_NO; -- cgit v1.2.3