summaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2015-09-27 23:20:13 +0200
committerDaniel Stenberg <daniel@haxx.se>2015-09-27 23:23:58 +0200
commitaf90becf4b91be3b45d9bbafa6366ed901c2572c (patch)
tree6e71984b544fb5cb5b2b131f412b82e809199f4c /lib/connect.c
parent46ad4f7f93d80998eba01ceaa6c2619e381a151e (diff)
downloadcurl-af90becf4b91be3b45d9bbafa6366ed901c2572c.tar.gz
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.
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/connect.c b/lib/connect.c
index 8a74b73e5..ece6cf3f6 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -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);