commit 0078559fbc964836b92d78bd0de5312c70cd67fb
parent f4e8fc67d46e0d7c5bc5f7a90d7db78129cbdc61
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Thu, 13 Jul 2017 19:24:06 +0300
Added new value MHD_FEATURE_AUTOSUPPRESS_SIGPIPE for MHD_is_feature_supported()
Diffstat:
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git 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
@@ -6552,6 +6552,12 @@ MHD_is_feature_supported(enum MHD_FEATURE feature)
#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;
}