зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1363108 - Fix some small bugs connectied to tcp fast open. r=mcmanus
This commit is contained in:
Родитель
36a497cf8d
Коммит
6ad0af18de
|
@ -1046,6 +1046,15 @@ nsSocketTransport::SendStatus(nsresult status)
|
|||
switch (status) {
|
||||
case NS_NET_STATUS_SENDING_TO:
|
||||
progress = mOutput.ByteCount();
|
||||
// If Fast Open is used, we buffer some data in TCPFastOpenLayer,
|
||||
// This data can be only tls data or application data as well.
|
||||
// socketTransport should send status only if it really has sent
|
||||
// application data. socketTransport cannot query transaction for
|
||||
// that info but it can know if transaction has send data if
|
||||
// mOutput.ByteCount() is > 0.
|
||||
if (progress == 0) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case NS_NET_STATUS_RECEIVING_FROM:
|
||||
progress = mInput.ByteCount();
|
||||
|
@ -1714,7 +1723,8 @@ nsSocketTransport::RecoverFromError()
|
|||
bool tryAgain = false;
|
||||
if (mFDFastOpenInProgress &&
|
||||
((mCondition == NS_ERROR_CONNECTION_REFUSED) ||
|
||||
(mCondition == NS_ERROR_NET_TIMEOUT))) {
|
||||
(mCondition == NS_ERROR_NET_TIMEOUT) ||
|
||||
(mCondition == NS_ERROR_PROXY_CONNECTION_REFUSED))) {
|
||||
// TCP Fast Open can be blocked by middle boxes so we will retry
|
||||
// without it.
|
||||
tryAgain = true;
|
||||
|
|
|
@ -2347,11 +2347,13 @@ nsHttpConnection::CloseConnectionFastOpenTakesTooLongOrError(bool aCloseSocketTr
|
|||
|
||||
mFastOpenStatus = TFO_FAILED;
|
||||
RefPtr<nsAHttpTransaction> trans;
|
||||
|
||||
DontReuse();
|
||||
|
||||
if (mUsingSpdyVersion) {
|
||||
// If we have a http2 connection just restart it as if 0rtt failed.
|
||||
// For http2 we do not nee to do similar thing as for http1 because
|
||||
// For http2 we do not need to do similar thing as for http1 because
|
||||
// backup connection will pick immediately all this transaction anyway.
|
||||
DontReuse();
|
||||
mUsingSpdyVersion = 0;
|
||||
if (mSpdySession) {
|
||||
mTransaction->SetFastOpenStatus(TFO_FAILED);
|
||||
|
|
|
@ -3445,7 +3445,6 @@ nsHalfOpenSocket::OnOutputStreamReady(nsIAsyncOutputStream *out)
|
|||
// listens for OnOutputStreamReady not HalfOpenSocket. So this stream
|
||||
// cannot be mStreamOut.
|
||||
MOZ_ASSERT(out == mBackupStreamOut);
|
||||
MOZ_ASSERT(mTransaction->IsNullTransaction());
|
||||
// Here the backup, non-TFO connection has connected successfully,
|
||||
// before the TFO connection.
|
||||
//
|
||||
|
|
Загрузка…
Ссылка в новой задаче