aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2019-04-17 15:54:40 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2019-04-17 15:54:40 +0300
commit6c985f4adcb5b71c2b70a17de0a99468090bfb0d (patch)
tree6da2ecf505572c6d3cde0f410c9ee8debfbe349c
parent7ce09bd9817e4913ece6b2294a13b2e7840a3ae1 (diff)
downloadlibmicrohttpd-6c985f4adcb5b71c2b70a17de0a99468090bfb0d.tar.gz
libmicrohttpd-6c985f4adcb5b71c2b70a17de0a99468090bfb0d.zip
File read block size: move to proper location
-rw-r--r--src/lib/response_from_fd.c17
-rw-r--r--src/microhttpd/mhd_limits.h8
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 @@
1/* 1/*
2 This file is part of libmicrohttpd 2 This file is part of libmicrohttpd
3 Copyright (C) 2007-2018 Daniel Pittman and Christian Grothoff 3 Copyright (C) 2007-2019 Daniel Pittman, Christian Grothoff and
4 Karlson2k (Evgeny Grin)
4 5
5 This library is free software; you can redistribute it and/or 6 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public 7 modify it under the terms of the GNU Lesser General Public
@@ -28,6 +29,18 @@
28 29
29 30
30/** 31/**
32 * Size of single file read operation for
33 * file-backed responses.
34 */
35#ifndef MHD_FILE_READ_BLOCK_SIZE
36#ifdef _WIN32
37#define MHD_FILE_READ_BLOCK_SIZE 16384 /* 16k */
38#else /* _WIN32 */
39#define MHD_FILE_READ_BLOCK_SIZE 4096 /* 4k */
40#endif /* _WIN32 */
41#endif /* !MHD_FD_BLOCK_SIZE */
42
43/**
31 * Given a file descriptor, read data from the file 44 * Given a file descriptor, read data from the file
32 * to generate the response. 45 * to generate the response.
33 * 46 *
@@ -182,7 +195,7 @@ MHD_response_from_fd (enum MHD_HTTP_StatusCode sc,
182 195
183 response = MHD_response_from_callback (sc, 196 response = MHD_response_from_callback (sc,
184 size, 197 size,
185 MHD_FD_BLOCK_SIZE, 198 MHD_FILE_READ_BLOCK_SIZE,
186 &file_reader, 199 &file_reader,
187 NULL, 200 NULL,
188 &free_callback); 201 &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 @@
143#endif /* _WIN32 */ 143#endif /* _WIN32 */
144#endif /* !TIMEVAL_TV_SEC_MAX */ 144#endif /* !TIMEVAL_TV_SEC_MAX */
145 145
146#ifndef MHD_FD_BLOCK_SIZE
147#ifdef _WIN32
148#define MHD_FD_BLOCK_SIZE 16384 /* 16k */
149#else /* _WIN32 */
150#define MHD_FD_BLOCK_SIZE 4096 /* 4k */
151#endif /* _WIN32 */
152#endif /* !MHD_FD_BLOCK_SIZE */
153
154#endif /* MHD_LIMITS_H */ 146#endif /* MHD_LIMITS_H */