gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r35902 - in libmicrohttpd/src: include microhttpd


From: gnunet
Subject: [GNUnet-SVN] r35902 - in libmicrohttpd/src: include microhttpd
Date: Tue, 9 Jun 2015 21:34:36 +0200

Author: Karlson2k
Date: 2015-06-09 21:34:36 +0200 (Tue, 09 Jun 2015)
New Revision: 35902

Modified:
   libmicrohttpd/src/include/microhttpd.h
   libmicrohttpd/src/microhttpd/daemon.c
   libmicrohttpd/src/microhttpd/response.c
Log:
Add MHD_FEATURE_LARGE_FILE value for MHD_is_feature_supported()

Modified: libmicrohttpd/src/include/microhttpd.h
===================================================================
--- libmicrohttpd/src/include/microhttpd.h      2015-06-09 19:34:27 UTC (rev 
35901)
+++ libmicrohttpd/src/include/microhttpd.h      2015-06-09 19:34:36 UTC (rev 
35902)
@@ -2087,7 +2087,7 @@
  *
  * @param size size of the data portion of the response;
  *        sizes larger than 2 GiB may be not supported by OS or
- *        MHD build
+ *        MHD build; see ::MHD_FEATURE_LARGE_FILE
  * @param fd file descriptor referring to a file on disk with the
  *        data; will be closed when response is destroyed;
  *        fd should be in 'blocking' mode
@@ -2128,13 +2128,13 @@
  *
  * @param size size of the data portion of the response;
  *        sizes larger than 2 GiB may be not supported by OS or
- *        MHD build
+ *        MHD build; see ::MHD_FEATURE_LARGE_FILE
  * @param fd file descriptor referring to a file on disk with the
  *        data; will be closed when response is destroyed;
  *        fd should be in 'blocking' mode
  * @param offset offset to start reading from in the file;
  *        reading file beyond 2 GiB may be not supported by OS or
- *        MHD build
+ *        MHD build; see ::MHD_FEATURE_LARGE_FILE
  * @return NULL on error (i.e. invalid arguments, out of memory)
  * @ingroup response
  */
@@ -2740,7 +2740,17 @@
   * supported. If supported then option
   * ::MHD_OPTION_HTTPS_KEY_PASSWORD can be used.
   */
-  MHD_FEATURE_HTTPS_KEY_PASSWORD = 14
+  MHD_FEATURE_HTTPS_KEY_PASSWORD = 14,
+
+  /**
+   * Get whether reading files beyond 2 GiB boundary is supported.
+   * If supported then #MHD_create_response_from_fd(), 
+   * #MHD_create_response_from_fd64 #MHD_create_response_from_fd_at_offset()
+   * and #MHD_create_response_from_fd_at_offset64() can be used with sizes and
+   * offsets larger than 2 GiB. If not supported value of size+offset is
+   * limited to 2 GiB.
+   */
+  MHD_FEATURE_LARGE_FILE = 15
 };
 
 

Modified: libmicrohttpd/src/microhttpd/daemon.c
===================================================================
--- libmicrohttpd/src/microhttpd/daemon.c       2015-06-09 19:34:27 UTC (rev 
35901)
+++ libmicrohttpd/src/microhttpd/daemon.c       2015-06-09 19:34:36 UTC (rev 
35902)
@@ -4768,6 +4768,12 @@
 #else
       return MHD_NO;
 #endif
+    case MHD_FEATURE_LARGE_FILE:
+#if defined(HAVE___LSEEKI64) || defined(HAVE_LSEEK64)
+      return MHD_YES;
+#else
+      return (sizeof(uint64_t) > sizeof(off_t)) ? MHD_NO : MHD_YES;
+#endif
     }
   return MHD_NO;
 }

Modified: libmicrohttpd/src/microhttpd/response.c
===================================================================
--- libmicrohttpd/src/microhttpd/response.c     2015-06-09 19:34:27 UTC (rev 
35901)
+++ libmicrohttpd/src/microhttpd/response.c     2015-06-09 19:34:36 UTC (rev 
35902)
@@ -410,13 +410,13 @@
  *
  * @param size size of the data portion of the response;
  *        sizes larger than 2 GiB may be not supported by OS or
- *        MHD build
+ *        MHD build; see ::MHD_FEATURE_LARGE_FILE
  * @param fd file descriptor referring to a file on disk with the
  *        data; will be closed when response is destroyed;
  *        fd should be in 'blocking' mode
  * @param offset offset to start reading from in the file;
  *        reading file beyond 2 GiB may be not supported by OS or
- *        MHD build
+ *        MHD build; see ::MHD_FEATURE_LARGE_FILE
  * @return NULL on error (i.e. invalid arguments, out of memory)
  * @ingroup response
  */
@@ -472,7 +472,7 @@
  *
  * @param size size of the data portion of the response;
  *        sizes larger than 2 GiB may be not supported by OS or
- *        MHD build
+ *        MHD build; see ::MHD_FEATURE_LARGE_FILE
  * @param fd file descriptor referring to a file on disk with the
  *        data; will be closed when response is destroyed;
  *        fd should be in 'blocking' mode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]