--- cyrus-imapd-2.3.8/imap/sync_client.c 2007-01-09 12:29:30.000000000 -0500 +++ cyrus-imapd-2.3.8+/imap/sync_client.c 2007-04-10 16:15:06.000000000 -0400 @@ -61,6 +61,8 @@ #include #include +#include + #include "global.h" #include "assert.h" #include "mboxlist.h" @@ -3191,6 +3193,20 @@ _exit(1); } + { + struct protoent *proto; + int one = 1; + + if (( proto = getprotobyname( "tcp" )) != NULL ) { + if ( setsockopt( be->sock, proto->p_proto, TCP_NODELAY, + &one, sizeof( one )) != 0 ) { + perror( "setsockopt TCP_NODELAY" ); + } + } else { + perror( "getprotobyname tcp" ); + } + } + return be; } --- cyrus-imapd-2.3.8/imap/sync_server.c 2006-11-30 12:11:20.000000000 -0500 +++ cyrus-imapd-2.3.8+/imap/sync_server.c 2007-04-10 16:15:31.000000000 -0400 @@ -63,6 +63,7 @@ #include #include #include +#include #include #include @@ -375,6 +376,20 @@ sync_in = prot_new(0, 0); sync_out = prot_new(1, 1); + { + struct protoent *proto; + int one = 1; + + if (( proto = getprotobyname( "tcp" )) != NULL ) { + if ( setsockopt( 1, proto->p_proto, TCP_NODELAY, + &one, sizeof( one )) != 0 ) { + syslog( LOG_ERR, "setsockopt TCP_NODELAY: %m" ); + } + } else { + syslog( LOG_ERR, "getprotobyname tcp: %m" ); + } + } + /* Find out name of client host */ salen = sizeof(sync_remoteaddr); if (getpeername(0, (struct sockaddr *)&sync_remoteaddr, &salen) == 0 &&