commit dbf407c26a3d76a26c1a28fbb8f7b810bcdbf16f
parent 679f259b952f418a8cf5edec9c071f3fa0e5850e
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date: Sun, 28 Nov 2021 19:38:18 +0300
Fixed MHD_FEATURE_AUTOSUPPRESS_SIGPIPE return value
Diffstat:
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -4543,7 +4543,7 @@ enum MHD_FEATURE
MHD_FEATURE_AUTODETECT_BIND_PORT = 19,
/**
- * Get whether MHD support SIGPIPE suppression.
+ * Get whether MHD supports automatic SIGPIPE suppression.
* If SIGPIPE suppression is not supported, application must handle
* SIGPIPE signal by itself.
*/
diff --git a/src/microhttpd/daemon.c b/src/microhttpd/daemon.c
@@ -8035,8 +8035,8 @@ MHD_is_feature_supported (enum MHD_FEATURE feature)
return MHD_NO;
#endif
case MHD_FEATURE_AUTOSUPPRESS_SIGPIPE:
-#if defined(MHD_SEND_SPIPE_SUPPRESS_POSSIBLE) && \
- defined(MHD_SEND_SPIPE_SUPPRESS_NEEDED)
+#if defined(MHD_SEND_SPIPE_SUPPRESS_POSSIBLE) || \
+ ! defined(MHD_SEND_SPIPE_SUPPRESS_NEEDED)
return MHD_YES;
#else
return MHD_NO;
diff --git a/src/microhttpd/mhd_sockets.h b/src/microhttpd/mhd_sockets.h
@@ -926,8 +926,8 @@ static const int _MHD_socket_int_one = 1;
/**
* Indicate that SIGPIPE can be suppressed by MHD for normal send() by flags
* or socket options.
- * If this macro is undefined, MHD cannot suppress SIGPIPE for normal
- * processing so sendfile() or writev() calls is not avoided.
+ * If this macro is undefined, MHD cannot suppress SIGPIPE for socket functions
+ * so sendfile() or writev() calls are avoided in application threads.
*/
#define MHD_SEND_SPIPE_SUPPRESS_POSSIBLE 1
#endif /* MHD_WINSOCK_SOCKETS || MHD_socket_nosignal_ || MSG_NOSIGNAL */