Fixing bug 267854. Make sure parser data listeners get all the data that comes in from necko, no matter what the current parser context is. r=bzbarsky@mit.edu, sr=brendan@mozilla.org, a=brendan@mozilla.org
git-svn-id: svn://10.0.0.236/branches/AVIARY_1_0_20040515_BRANCH@164984 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1492,12 +1492,12 @@ void nsParser::HandleParserContinueEvent() {
|
||||
ContinueParsing();
|
||||
}
|
||||
|
||||
nsresult nsParser::DataAdded(const nsSubstring& aData)
|
||||
nsresult nsParser::DataAdded(const nsSubstring& aData, nsIRequest *aRequest)
|
||||
{
|
||||
NS_ASSERTION(sParserDataListeners,
|
||||
"Don't call this with no parser data listeners!");
|
||||
|
||||
if (!mSink || !mParserContext || !mParserContext->mRequest) {
|
||||
if (!mSink || !aRequest) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -1508,10 +1508,10 @@ nsresult nsParser::DataAdded(const nsSubstring& aData)
|
||||
|
||||
while (count--) {
|
||||
rv |= sParserDataListeners->ObjectAt(count)->
|
||||
OnUnicharDataAvailable(mParserContext->mRequest, ctx, aData);
|
||||
OnUnicharDataAvailable(aRequest, ctx, aData);
|
||||
|
||||
if (NS_FAILED(rv) && !canceled) {
|
||||
mParserContext->mRequest->Cancel(rv);
|
||||
aRequest->Cancel(rv);
|
||||
|
||||
canceled = PR_TRUE;
|
||||
}
|
||||
@@ -2478,7 +2478,7 @@ ParserWriteFunc(nsIInputStream* in,
|
||||
if(pws->mParserFilter)
|
||||
pws->mParserFilter->RawBuffer(buf, &theNumRead);
|
||||
|
||||
result = pws->mScanner->Append(buf, theNumRead);
|
||||
result = pws->mScanner->Append(buf, theNumRead, pws->mRequest);
|
||||
if (NS_SUCCEEDED(result)) {
|
||||
*writeCount = count;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user