gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [libmicrohttpd] branch master updated: File read block size


From: gnunet
Subject: [GNUnet-SVN] [libmicrohttpd] branch master updated: File read block size: move to proper location
Date: Wed, 17 Apr 2019 14:55:14 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

The following commit(s) were added to refs/heads/master by this push:
     new 6c985f4a File read block size: move to proper location
6c985f4a is described below

commit 6c985f4adcb5b71c2b70a17de0a99468090bfb0d
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Wed Apr 17 15:54:40 2019 +0300

    File read block size: move to proper location
---
 src/lib/response_from_fd.c  | 17 +++++++++++++++--
 src/microhttpd/mhd_limits.h |  8 --------
 2 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/src/lib/response_from_fd.c b/src/lib/response_from_fd.c
index 6eac3f7f..ac0a54d1 100644
--- a/src/lib/response_from_fd.c
+++ b/src/lib/response_from_fd.c
@@ -1,6 +1,7 @@
 /*
   This file is part of libmicrohttpd
-  Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff
+  Copyright (C) 2007-2019 Daniel Pittman, Christian Grothoff and
+  Karlson2k (Evgeny Grin)
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -27,6 +28,18 @@
 #include "internal.h"
 
 
+/**
+ * Size of single file read operation for
+ * file-backed responses.
+ */
+#ifndef MHD_FILE_READ_BLOCK_SIZE
+#ifdef _WIN32
+#define MHD_FILE_READ_BLOCK_SIZE 16384 /* 16k */
+#else /* _WIN32 */
+#define MHD_FILE_READ_BLOCK_SIZE 4096 /* 4k */
+#endif /* _WIN32 */
+#endif /* !MHD_FD_BLOCK_SIZE */
+
 /**
  * Given a file descriptor, read data from the file
  * to generate the response.
@@ -182,7 +195,7 @@ MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
 
   response = MHD_response_from_callback (sc,
                                         size,
-                                        MHD_FD_BLOCK_SIZE,
+                                        MHD_FILE_READ_BLOCK_SIZE,
                                         &file_reader,
                                         NULL,
                                         &free_callback);
diff --git a/src/microhttpd/mhd_limits.h b/src/microhttpd/mhd_limits.h
index 41d33a8f..1b0f5d7d 100644
--- a/src/microhttpd/mhd_limits.h
+++ b/src/microhttpd/mhd_limits.h
@@ -143,12 +143,4 @@
 #endif /* _WIN32 */
 #endif /* !TIMEVAL_TV_SEC_MAX */
 
-#ifndef MHD_FD_BLOCK_SIZE
-#ifdef _WIN32
-#define MHD_FD_BLOCK_SIZE 16384 /* 16k */
-#else /* _WIN32 */
-#define MHD_FD_BLOCK_SIZE 4096 /* 4k */
-#endif /* _WIN32 */
-#endif /* !MHD_FD_BLOCK_SIZE */
-
 #endif /* MHD_LIMITS_H */

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

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