[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [libmicrohttpd] 03/03: Improved 5ac497e212525a12209a3c1007a
From: |
gnunet |
Subject: |
[GNUnet-SVN] [libmicrohttpd] 03/03: Improved 5ac497e212525a12209a3c1007a129ae85055cf7 |
Date: |
Sun, 01 Oct 2017 20:39:24 +0200 |
This is an automated email from the git hooks/post-receive script.
karlson2k pushed a commit to branch master
in repository libmicrohttpd.
commit f2f1d659156666b61c2f4198c88a3ceaf88ce9f5
Author: Evgeny Grin (Karlson2k) <address@hidden>
AuthorDate: Sun Oct 1 21:38:15 2017 +0300
Improved 5ac497e212525a12209a3c1007a129ae85055cf7
---
src/microhttpd/connection.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/microhttpd/connection.c b/src/microhttpd/connection.c
index a7ad7220..fbe9f9d3 100644
--- a/src/microhttpd/connection.c
+++ b/src/microhttpd/connection.c
@@ -239,6 +239,7 @@ sendfile_adapter (struct MHD_Connection *connection)
off64_t offset;
#endif /* HAVE_SENDFILE64 */
const bool used_thr_p_c = (0 != (connection->daemon->options &
MHD_USE_THREAD_PER_CONNECTION));
+ const size_t chunk_size = used_thr_p_c ? 0x200000 : 0x20000;
size_t send_size;
mhd_assert (MHD_resp_sender_sendfile == connection->resp_sender);
@@ -246,10 +247,7 @@ sendfile_adapter (struct MHD_Connection *connection)
left = connection->response->total_size -
connection->response_write_position;
/* Do not allow system to stick sending on single fast connection:
* use 128KiB chunks (2MiB for thread-per-connection). */
- if (!used_thr_p_c)
- send_size = (left > 0x20000) ? 0x20000 : (size_t) left;
- else
- send_size = (left > 0x200000) ? 0x200000 : (size_t) left;
+ send_size = (left > chunk_size) ? chunk_size : (size_t) left;
#ifndef HAVE_SENDFILE64
if ((uint64_t)OFF_T_MAX < offsetu64)
{ /* Retry to send with standard 'send()'. */
--
To stop receiving notification emails like this one, please contact
address@hidden