libmicrohttpd

HTTP/1.x server C library (MHD 1.x, stable)
Log | Files | Refs | Submodules | README | LICENSE

commit 6c985f4adcb5b71c2b70a17de0a99468090bfb0d
parent 7ce09bd9817e4913ece6b2294a13b2e7840a3ae1
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
Date:   Wed, 17 Apr 2019 15:54:40 +0300

File read block size: move to proper location

Diffstat:
Msrc/lib/response_from_fd.c | 17+++++++++++++++--
Msrc/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 @@ -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 @@ -28,6 +29,18 @@ /** + * 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 @@ -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 */