Bug 743178, CORS may keep XHR alive too long, r=bz, a=tracking-firefox14+

This commit is contained in:
Olli Pettay 2012-04-17 23:55:40 +03:00
Родитель 0ba3045c86
Коммит 63d3675987
2 изменённых файлов: 11 добавлений и 1 удалений

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

@ -639,7 +639,13 @@ nsCORSListenerProxy::OnStopRequest(nsIRequest* aRequest,
nsISupports* aContext,
nsresult aStatusCode)
{
return mOuterListener->OnStopRequest(aRequest, aContext, aStatusCode);
nsresult rv = mOuterListener->OnStopRequest(aRequest, aContext, aStatusCode);
mOuterListener = nsnull;
mOuterNotificationCallbacks = nsnull;
mRedirectCallback = nsnull;
mOldRedirectChannel = nsnull;
mNewRedirectChannel = nsnull;
return rv;
}
NS_IMETHODIMP
@ -1026,6 +1032,9 @@ nsCORSPreflightListener::OnStopRequest(nsIRequest *aRequest,
nsISupports *aContext,
nsresult aStatus)
{
mOuterChannel = nsnull;
mOuterListener = nsnull;
mOuterContext = nsnull;
return NS_OK;
}

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

@ -2502,6 +2502,7 @@ nsXMLHttpRequest::ChangeStateToDone()
// methods/members will not throw.
// This matches what IE does.
mChannel = nsnull;
mCORSPreflightChannel = nsnull;
}
else if (!(mState & XML_HTTP_REQUEST_GOT_FINAL_STOP)) {
// We're a multipart request, so we're not done. Reset to opened.