зеркало из https://github.com/mozilla/gecko-dev.git
bug 742935: fix landing problem with 603512 r=honzab
This commit is contained in:
Родитель
64089509b5
Коммит
b1ee77a7cf
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче