зеркало из https://github.com/mozilla/gecko-dev.git
Bug 542401 - Look into whether Firefox should set TCP_NODELAY for non-SSL HTTP socket r=jduell
indeed without nagle disabled (which is what nodelay does) a pipeline can be interrupted for a full rtt waiting for an ack, which defeats the purpose of pipelining. Other parts of FF can just coalesce the writes internally, but sometimes that is not possible for pipelines which may not have an opportunity for a pipelined request when the "runt" packet goes out, but discovers such an opportunity a long time before the rtt is expired. In other places (such as long posts) we do a fine job of coalescing already, so this should not result in any extra packets on the wire, just improved latency. --HG-- extra : rebase_source : e333e36fe31b63d17c287ac6e876f27fdb69ce5b
This commit is contained in:
Родитель
c742414ab8
Коммит
6062e12478
|
@ -1122,6 +1122,13 @@ nsSocketTransport::InitiateSocket()
|
|||
status = PR_SetSocketOption(fd, &opt);
|
||||
NS_ASSERTION(status == PR_SUCCESS, "unable to make socket non-blocking");
|
||||
|
||||
// disable the nagle algorithm - if we rely on it to coalesce writes into
|
||||
// full packets the final packet of a multi segment POST/PUT or pipeline
|
||||
// sequence is delayed a full rtt
|
||||
opt.option = PR_SockOpt_NoDelay;
|
||||
opt.value.no_delay = PR_TRUE;
|
||||
PR_SetSocketOption(fd, &opt);
|
||||
|
||||
// if the network.tcp.sendbuffer preference is set, use it to size SO_SNDBUF
|
||||
// The Windows default of 8KB is too small and as of vista sp1, autotuning
|
||||
// only applies to receive window
|
||||
|
|
Загрузка…
Ссылка в новой задаче