2
0
Эх сурвалжийг харах

Added new value MHD_FEATURE_AUTOSUPPRESS_SIGPIPE for MHD_is_feature_supported()

Evgeny Grin (Karlson2k) 8 жил өмнө
parent
commit
0078559fbc

+ 9 - 2
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
 };
 
 

+ 6 - 0
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;