Implement disabling TCP_NODELAY, but comment it out.

It makes performance worse.
This commit is contained in:
Emil Mikulic 2006-12-13 13:28:10 +00:00
parent 008f6f5d4e
commit 3e96ddf6d6
1 changed files with 9 additions and 0 deletions

View File

@ -44,6 +44,7 @@ static const int debug = 1;
#include <sys/wait.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <arpa/inet.h>
#include <assert.h>
#include <ctype.h>
@ -872,6 +873,14 @@ static void init_sockin(void)
&sockopt, sizeof(sockopt)) == -1)
err(1, "setsockopt(SO_REUSEADDR)");
#if 0
/* disable Nagle since we buffer everything ourselves */
sockopt = 1;
if (setsockopt(sockin, IPPROTO_TCP, TCP_NODELAY,
&sockopt, sizeof(sockopt)) == -1)
err(1, "setsockopt(TCP_NODELAY)");
#endif
#ifdef TORTURE
/* torture: cripple the kernel-side send buffer so we can only squeeze out
* one byte at a time (this is for debugging)