bug 766312 - part 1 - pipeline cancelation could be "undone" r=honzab

This commit is contained in:
Patrick McManus 2012-06-28 18:06:32 -04:00
parent 680c2f89d4
commit 5eafa03052
2 changed files with 7 additions and 1 deletions

View File

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

View File

@ -217,6 +217,7 @@ private:
bool mKeepAlive;
bool mKeepAliveMask;
bool mDontReuse;
bool mSupportsPipelining;
bool mIsReused;
bool mCompletedProxyConnect;