proxy: Turn on TCP_NODELAY for the proxy->upstream leg

Nagle doesn't actually affect us too badly here, as we don't write
the header and then the data in two separate calls under normal
circumstances, which is the pathological case, but we should have
NODELAY on, regardless
This commit is contained in:
nick
2014-02-25 15:59:05 +00:00
parent 7806ec11ee
commit f9a3447bc9

View File

@@ -186,6 +186,13 @@ void proxy_finish_connect_to_upstream( struct proxier *proxy, off64_t size ) {
} }
proxy->upstream_size = size; proxy->upstream_size = size;
if ( AF_UNIX != proxy->connect_to.family ) {
if ( sock_set_tcp_nodelay( proxy->upstream_fd, 1 ) == -1 ) {
warn( SHOW_ERRNO( "Failed to set TCP_NODELAY" ) );
}
}
info( "Connected to upstream on fd %i", proxy->upstream_fd ); info( "Connected to upstream on fd %i", proxy->upstream_fd );
return; return;