Ver Fonte

Added MHD_FEATURE_SENDFILE test feature

Evgeny Grin (Karlson2k) há 8 anos atrás
pai
commit
add9d89d3b
3 ficheiros alterados com 18 adições e 1 exclusões
  1. 3 0
      ChangeLog
  2. 8 1
      src/include/microhttpd.h
  3. 7 0
      src/microhttpd/daemon.c

+ 3 - 0
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

+ 8 - 1
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
 };
 
 

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