bug 742935: fix landing problem with 603512 r=honzab

This commit is contained in:
Patrick McManus 2012-04-09 10:21:17 -04:00
Родитель 64089509b5
Коммит b1ee77a7cf
8 изменённых файлов: 17 добавлений и 10 удалений

Просмотреть файл

@ -122,7 +122,7 @@ public:
// called to determine or set if a connection has been reused.
virtual bool IsReused() = 0;
virtual void DontReuse() = 0;
virtual void DontReuse() = 0;
// called by a transaction when the transaction reads more from the socket
// than it should have (eg. containing part of the next pipelined response).

Просмотреть файл

@ -67,6 +67,8 @@ public:
mTrailers = nsnull;
return h; }
PRUint32 GetChunkRemaining() { return mChunkRemaining; }
private:
nsresult ParseChunkRemaining(char *buf,
PRUint32 count,

Просмотреть файл

@ -56,6 +56,7 @@
#include "SpdySession.h"
#include "mozilla/Telemetry.h"
#include "nsISupportsPriority.h"
#include "nsHttpPipeline.h"
#ifdef DEBUG
// defined by the socket transport service while active

Просмотреть файл

@ -42,7 +42,6 @@
#include "nsHttp.h"
#include "nsHttpConnectionInfo.h"
#include "nsAHttpTransaction.h"
#include "nsHttpPipeline.h"
#include "nsXPIDLString.h"
#include "nsCOMPtr.h"
#include "nsAutoPtr.h"

Просмотреть файл

@ -55,7 +55,7 @@
#include "nsITimer.h"
#include "nsIX509Cert3.h"
#include "nsHttpPipeline.h"
class nsHttpPipeline;
//-----------------------------------------------------------------------------

Просмотреть файл

@ -233,9 +233,9 @@ public:
nsCString& hostLine);
bool GetPipelineAggressive() { return mPipelineAggressive; }
void GetMaxPipelineObjectSize(PRInt64 &outVal)
void GetMaxPipelineObjectSize(PRInt64 *outVal)
{
outVal = mMaxPipelineObjectSize;
*outVal = mMaxPipelineObjectSize;
}
PRIntervalTime GetPipelineTimeout() { return mPipelineReadTimeout; }

Просмотреть файл

@ -294,9 +294,10 @@ nsHttpPipeline::CloseTransaction(nsAHttpTransaction *trans, nsresult reason)
trans->Close(reason);
NS_RELEASE(trans);
if (killPipeline)
if (killPipeline) {
// reschedule anything from this pipeline onto a different connection
CancelPipeline(reason);
}
}
void
@ -843,7 +844,9 @@ nsHttpPipeline::CancelPipeline(nsresult originalReason)
mRequestQ.Clear();
// any pending responses can be restarted except for the first one,
// that we might want to finish on this pipeline or cancel individually
// that we might want to finish on this pipeline or cancel individually.
// Higher levels of callers ensure that we don't process non-idempotent
// tranasction with the NS_HTTP_ALLOW_PIPELINING bit set
for (i = 1; i < respLen; ++i) {
trans = Response(i);
trans->Close(NS_ERROR_NET_RESET);

Просмотреть файл

@ -144,7 +144,7 @@ nsHttpTransaction::nsHttpTransaction()
, mResponseHeadTaken(false)
{
LOG(("Creating nsHttpTransaction @%x\n", this));
gHttpHandler->GetMaxPipelineObjectSize(mMaxPipelineObjectSize);
gHttpHandler->GetMaxPipelineObjectSize(&mMaxPipelineObjectSize);
}
nsHttpTransaction::~nsHttpTransaction()
@ -1366,8 +1366,10 @@ nsHttpTransaction::HandleContent(char *buf,
// for this response reschedule the pipeline
if ((mClassification != CLASS_SOLO) &&
mChunkedDecoder &&
(mContentRead > mMaxPipelineObjectSize))
((mContentRead + mChunkedDecoder->GetChunkRemaining()) >
mMaxPipelineObjectSize)) {
CancelPipeline(nsHttpConnectionMgr::BadUnexpectedLarge);
}
// check for end-of-file
if ((mContentRead == mContentLength) ||
@ -1479,7 +1481,7 @@ nsHttpTransaction::CancelPipeline(PRUint32 reason)
static_cast<nsHttpConnectionMgr::PipelineFeedbackInfoType>(reason),
nsnull, mClassification);
mConnection->CancelPipeline(NS_ERROR_CORRUPTED_CONTENT);
mConnection->CancelPipeline(NS_ERROR_ABORT);
// Avoid pipelining this transaction on restart by classifying it as solo.
// This also prevents BadUnexpectedLarge from being reported more