aboutsummaryrefslogtreecommitdiff
path: root/lib/http2.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/http2.c
parent46ad4f7f93d80998eba01ceaa6c2619e381a151e (diff)
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/http2.c')
-rw-r--r--lib/http2.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 05b919625..de6d03d39 100644
--- a/lib/http2.c
+++ b/lib/http2.c
@@ -34,6 +34,7 @@
#include "multiif.h"
#include "conncache.h"
#include "url.h"
+#include "connect.h"
/* The last #include files should be: */
#include "curl_memory.h"
@@ -1441,6 +1442,10 @@ CURLcode Curl_http2_setup(struct connectdata *conn)
infof(conn->data, "Connection state changed (HTTP/2 confirmed)\n");
Curl_multi_connchanged(conn->data->multi);
+ /* switch on TCP_NODELAY as we need to send off packets without delay for
+ maximum throughput */
+ Curl_tcpnodelay(conn, conn->sock[FIRSTSOCKET]);
+
return CURLE_OK;
}