mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 23:35:34 +00:00
bug 766312 - part 1 - pipeline cancelation could be "undone" r=honzab
This commit is contained in:
parent
680c2f89d4
commit
5eafa03052
@ -49,6 +49,7 @@ nsHttpConnection::nsHttpConnection()
|
||||
, mTotalBytesWritten(0)
|
||||
, mKeepAlive(true) // assume to keep-alive by default
|
||||
, mKeepAliveMask(true)
|
||||
, mDontReuse(false)
|
||||
, mSupportsPipelining(false) // assume low-grade server
|
||||
, mIsReused(false)
|
||||
, mCompletedProxyConnect(false)
|
||||
@ -516,6 +517,7 @@ nsHttpConnection::DontReuse()
|
||||
{
|
||||
mKeepAliveMask = false;
|
||||
mKeepAlive = false;
|
||||
mDontReuse = true;
|
||||
mIdleTimeout = 0;
|
||||
if (mSpdySession)
|
||||
mSpdySession->DontReuse();
|
||||
@ -532,12 +534,15 @@ nsHttpConnection::SupportsPipelining()
|
||||
this, mTransaction->PipelineDepth(), mRemainingConnectionUses));
|
||||
return false;
|
||||
}
|
||||
return mSupportsPipelining && IsKeepAlive();
|
||||
return mSupportsPipelining && IsKeepAlive() && !mDontReuse;
|
||||
}
|
||||
|
||||
bool
|
||||
nsHttpConnection::CanReuse()
|
||||
{
|
||||
if (mDontReuse)
|
||||
return false;
|
||||
|
||||
if ((mTransaction ? mTransaction->PipelineDepth() : 0) >=
|
||||
mRemainingConnectionUses) {
|
||||
return false;
|
||||
|
@ -217,6 +217,7 @@ private:
|
||||
|
||||
bool mKeepAlive;
|
||||
bool mKeepAliveMask;
|
||||
bool mDontReuse;
|
||||
bool mSupportsPipelining;
|
||||
bool mIsReused;
|
||||
bool mCompletedProxyConnect;
|
||||
|
Loading…
Reference in New Issue
Block a user