Skip to content

Commit

Permalink
lib: Define NET_BLOCK_SIZE.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stephanbosch authored and sirainen committed May 23, 2018
1 parent 2155f0b commit 0afc714
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/compat.h
Expand Up @@ -295,6 +295,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 */
Expand Down

0 comments on commit 0afc714

Please sign in to comment.