From 1fca10509d8865df8e3097e621943a7b795e202c Mon Sep 17 00:00:00 2001 From: Stephan Bosch Date: Tue, 22 May 2018 09:42:00 +0200 Subject: [PATCH] lib: Define NET_BLOCK_SIZE. This defines the default size for data blocks transferred over the network. It should be large enough to guarantee filling up the TCP window (for efficiency), while still preventing sending much data while the peer has already rejected the rest of the transfer. --- src/lib/compat.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lib/compat.h b/src/lib/compat.h index af6c914dd8..d287b6572c 100644 --- a/src/lib/compat.h +++ b/src/lib/compat.h @@ -294,6 +294,10 @@ int fdatasync(int); #ifndef IO_BLOCK_SIZE # define IO_BLOCK_SIZE 8192 #endif +/* Default size for data blocks transferred over the network */ +#ifndef NET_BLOCK_SIZE +# define NET_BLOCK_SIZE (128*1024) +#endif #if !defined(PIPE_BUF) && defined(_POSIX_PIPE_BUF) # define PIPE_BUF (8 * _POSIX_PIPE_BUF) /* for HURD */ -- 2.47.3