зеркало из 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;
|
mTrailers = nsnull;
|
||||||
return h; }
|
return h; }
|
||||||
|
|
||||||
|
PRUint32 GetChunkRemaining() { return mChunkRemaining; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
nsresult ParseChunkRemaining(char *buf,
|
nsresult ParseChunkRemaining(char *buf,
|
||||||
PRUint32 count,
|
PRUint32 count,
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
#include "SpdySession.h"
|
#include "SpdySession.h"
|
||||||
#include "mozilla/Telemetry.h"
|
#include "mozilla/Telemetry.h"
|
||||||
#include "nsISupportsPriority.h"
|
#include "nsISupportsPriority.h"
|
||||||
|
#include "nsHttpPipeline.h"
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// defined by the socket transport service while active
|
// defined by the socket transport service while active
|
||||||
|
|
|
@ -42,7 +42,6 @@
|
||||||
#include "nsHttp.h"
|
#include "nsHttp.h"
|
||||||
#include "nsHttpConnectionInfo.h"
|
#include "nsHttpConnectionInfo.h"
|
||||||
#include "nsAHttpTransaction.h"
|
#include "nsAHttpTransaction.h"
|
||||||
#include "nsHttpPipeline.h"
|
|
||||||
#include "nsXPIDLString.h"
|
#include "nsXPIDLString.h"
|
||||||
#include "nsCOMPtr.h"
|
#include "nsCOMPtr.h"
|
||||||
#include "nsAutoPtr.h"
|
#include "nsAutoPtr.h"
|
||||||
|
|
|
@ -55,7 +55,7 @@
|
||||||
#include "nsITimer.h"
|
#include "nsITimer.h"
|
||||||
#include "nsIX509Cert3.h"
|
#include "nsIX509Cert3.h"
|
||||||
|
|
||||||
#include "nsHttpPipeline.h"
|
class nsHttpPipeline;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -233,9 +233,9 @@ public:
|
||||||
nsCString& hostLine);
|
nsCString& hostLine);
|
||||||
|
|
||||||
bool GetPipelineAggressive() { return mPipelineAggressive; }
|
bool GetPipelineAggressive() { return mPipelineAggressive; }
|
||||||
void GetMaxPipelineObjectSize(PRInt64 &outVal)
|
void GetMaxPipelineObjectSize(PRInt64 *outVal)
|
||||||
{
|
{
|
||||||
outVal = mMaxPipelineObjectSize;
|
*outVal = mMaxPipelineObjectSize;
|
||||||
}
|
}
|
||||||
PRIntervalTime GetPipelineTimeout() { return mPipelineReadTimeout; }
|
PRIntervalTime GetPipelineTimeout() { return mPipelineReadTimeout; }
|
||||||
|
|
||||||
|
|
|
@ -294,9 +294,10 @@ nsHttpPipeline::CloseTransaction(nsAHttpTransaction *trans, nsresult reason)
|
||||||
trans->Close(reason);
|
trans->Close(reason);
|
||||||
NS_RELEASE(trans);
|
NS_RELEASE(trans);
|
||||||
|
|
||||||
if (killPipeline)
|
if (killPipeline) {
|
||||||
// reschedule anything from this pipeline onto a different connection
|
// reschedule anything from this pipeline onto a different connection
|
||||||
CancelPipeline(reason);
|
CancelPipeline(reason);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -843,7 +844,9 @@ nsHttpPipeline::CancelPipeline(nsresult originalReason)
|
||||||
mRequestQ.Clear();
|
mRequestQ.Clear();
|
||||||
|
|
||||||
// any pending responses can be restarted except for the first one,
|
// 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) {
|
for (i = 1; i < respLen; ++i) {
|
||||||
trans = Response(i);
|
trans = Response(i);
|
||||||
trans->Close(NS_ERROR_NET_RESET);
|
trans->Close(NS_ERROR_NET_RESET);
|
||||||
|
|
|
@ -144,7 +144,7 @@ nsHttpTransaction::nsHttpTransaction()
|
||||||
, mResponseHeadTaken(false)
|
, mResponseHeadTaken(false)
|
||||||
{
|
{
|
||||||
LOG(("Creating nsHttpTransaction @%x\n", this));
|
LOG(("Creating nsHttpTransaction @%x\n", this));
|
||||||
gHttpHandler->GetMaxPipelineObjectSize(mMaxPipelineObjectSize);
|
gHttpHandler->GetMaxPipelineObjectSize(&mMaxPipelineObjectSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsHttpTransaction::~nsHttpTransaction()
|
nsHttpTransaction::~nsHttpTransaction()
|
||||||
|
@ -1366,8 +1366,10 @@ nsHttpTransaction::HandleContent(char *buf,
|
||||||
// for this response reschedule the pipeline
|
// for this response reschedule the pipeline
|
||||||
if ((mClassification != CLASS_SOLO) &&
|
if ((mClassification != CLASS_SOLO) &&
|
||||||
mChunkedDecoder &&
|
mChunkedDecoder &&
|
||||||
(mContentRead > mMaxPipelineObjectSize))
|
((mContentRead + mChunkedDecoder->GetChunkRemaining()) >
|
||||||
|
mMaxPipelineObjectSize)) {
|
||||||
CancelPipeline(nsHttpConnectionMgr::BadUnexpectedLarge);
|
CancelPipeline(nsHttpConnectionMgr::BadUnexpectedLarge);
|
||||||
|
}
|
||||||
|
|
||||||
// check for end-of-file
|
// check for end-of-file
|
||||||
if ((mContentRead == mContentLength) ||
|
if ((mContentRead == mContentLength) ||
|
||||||
|
@ -1479,7 +1481,7 @@ nsHttpTransaction::CancelPipeline(PRUint32 reason)
|
||||||
static_cast<nsHttpConnectionMgr::PipelineFeedbackInfoType>(reason),
|
static_cast<nsHttpConnectionMgr::PipelineFeedbackInfoType>(reason),
|
||||||
nsnull, mClassification);
|
nsnull, mClassification);
|
||||||
|
|
||||||
mConnection->CancelPipeline(NS_ERROR_CORRUPTED_CONTENT);
|
mConnection->CancelPipeline(NS_ERROR_ABORT);
|
||||||
|
|
||||||
// Avoid pipelining this transaction on restart by classifying it as solo.
|
// Avoid pipelining this transaction on restart by classifying it as solo.
|
||||||
// This also prevents BadUnexpectedLarge from being reported more
|
// This also prevents BadUnexpectedLarge from being reported more
|
||||||
|
|
Загрузка…
Ссылка в новой задаче