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:
Daniel Stenberg
2015-09-27 23:20:13 +02:00
parent 46ad4f7f93
commit af90becf4b
3 changed files with 11 additions and 5 deletions

View File

@@ -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;
}