http2: set TCP_NODELAY unconditionally
For a single-stream download from localhost, we managed to increase transfer speed from 1.6MB/sec to around 400MB/sec, mostly because of this single fix.
This commit is contained in:
@@ -857,12 +857,11 @@ CURLcode Curl_is_connected(struct connectdata *conn,
|
||||
return result;
|
||||
}
|
||||
|
||||
static void tcpnodelay(struct connectdata *conn,
|
||||
curl_socket_t sockfd)
|
||||
void Curl_tcpnodelay(struct connectdata *conn, curl_socket_t sockfd)
|
||||
{
|
||||
#ifdef TCP_NODELAY
|
||||
struct SessionHandle *data= conn->data;
|
||||
curl_socklen_t onoff = (curl_socklen_t) data->set.tcp_nodelay;
|
||||
curl_socklen_t onoff = (curl_socklen_t) 1;
|
||||
int level = IPPROTO_TCP;
|
||||
|
||||
#if 0
|
||||
@@ -1033,7 +1032,7 @@ static CURLcode singleipconnect(struct connectdata *conn,
|
||||
is_tcp = (addr.family == AF_INET) && addr.socktype == SOCK_STREAM;
|
||||
#endif
|
||||
if(is_tcp && data->set.tcp_nodelay)
|
||||
tcpnodelay(conn, sockfd);
|
||||
Curl_tcpnodelay(conn, sockfd);
|
||||
|
||||
nosigpipe(conn, sockfd);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user