From 274770803ee42a2b92aa552daab315bfad1c5d3e Mon Sep 17 00:00:00 2001 From: Sebastian Hengst Date: Mon, 3 Jul 2017 11:31:16 +0200 Subject: [PATCH] Backed out changeset 8597b133717f (bug 1377004) for crashing many tests with mozilla::net::nsHttpConnectionMgr::nsHalfOpenSocket::SetFastOpenConnected. r=backout on a CLOSED TREE --- modules/libpref/init/all.js | 2 +- netwerk/base/TCPFastOpenLayer.cpp | 4 ++-- netwerk/protocol/http/nsHttpConnectionMgr.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 45aaedcd7a03..a029c15e8b3a 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -4699,7 +4699,7 @@ pref("network.tcp.keepalive.retry_interval", 1); // seconds pref("network.tcp.keepalive.probe_count", 4); #endif -pref("network.tcp.tcp_fastopen_enable", true); +pref("network.tcp.tcp_fastopen_enable", false); pref("network.tcp.tcp_fastopen_consecutive_failure_limit", 5); // Whether to disable acceleration for all widgets. diff --git a/netwerk/base/TCPFastOpenLayer.cpp b/netwerk/base/TCPFastOpenLayer.cpp index 3bb9641b6f6c..c4ab5249bf12 100644 --- a/netwerk/base/TCPFastOpenLayer.cpp +++ b/netwerk/base/TCPFastOpenLayer.cpp @@ -400,8 +400,8 @@ TCPFastOpenFinish(PRFileDesc *fd, PRErrorCode &err, // We have some data ready in the buffer we will send it with the syn // packet. PRInt32 rv = (tfoFd->lower->methods->sendto)(tfoFd->lower, - nullptr, - 0, + secret->mFirstPacketBuf, + secret->mFirstPacketBufLen, 0, //flags &secret->mAddr, PR_INTERVAL_NO_WAIT); diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp index 7077794c394a..389421f55966 100644 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp @@ -4259,7 +4259,12 @@ nsHalfOpenSocket::SetFastOpenConnected(nsresult aError, bool aWillRetry) mStreamOut = nullptr; mStreamIn = nullptr; - Abandon(); + // If backup transport ha already started put this HalfOpen back to + // mEnt list. + if (mBackupTransport) { + mEnt->mHalfOpens.AppendElement(this); + gHttpHandler->ConnMgr()->mNumHalfOpenConns++; + } } mFastOpenInProgress = false;