Bug 779100 - HSTS redirect load group management fix, r=jduell

This commit is contained in:
Honza Bambas 2012-09-27 21:35:08 +02:00
parent 020743deb1
commit bd83f933cf
2 changed files with 12 additions and 7 deletions

View File

@ -1596,7 +1596,8 @@ nsHttpChannel::AsyncRedirectChannelToHttps()
nsresult
nsHttpChannel::ContinueAsyncRedirectChannelToHttps(nsresult rv)
{
AutoRedirectVetoNotifier notifier(this);
if (NS_SUCCEEDED(rv))
rv = OpenRedirectChannel(rv);
if (NS_FAILED(rv)) {
// Fill the failure status here, the update to https had been vetoed
@ -1613,9 +1614,16 @@ nsHttpChannel::ContinueAsyncRedirectChannelToHttps(nsresult rv)
// that would call our OnStart/StopRequest after resume from waiting for
// the redirect callback.
DoNotifyListener();
return rv;
}
return rv;
}
nsresult
nsHttpChannel::OpenRedirectChannel(nsresult rv)
{
AutoRedirectVetoNotifier notifier(this);
// Make sure to do this _after_ calling OnChannelRedirect
mRedirectChannel->SetOriginalURI(mOriginalURI);
@ -1627,8 +1635,6 @@ nsHttpChannel::ContinueAsyncRedirectChannelToHttps(nsresult rv)
// versions.
rv = httpEventSink->OnRedirect(this, mRedirectChannel);
if (NS_FAILED(rv)) {
mStatus = rv;
DoNotifyListener();
return rv;
}
}
@ -1636,8 +1642,6 @@ nsHttpChannel::ContinueAsyncRedirectChannelToHttps(nsresult rv)
// open new channel
rv = mRedirectChannel->AsyncOpen(mListener, mListenerContext);
if (NS_FAILED(rv)) {
mStatus = rv;
DoNotifyListener();
return rv;
}
@ -1653,7 +1657,7 @@ nsHttpChannel::ContinueAsyncRedirectChannelToHttps(nsresult rv)
mCallbacks = nullptr;
mProgressSink = nullptr;
return rv;
return NS_OK;
}
nsresult

View File

@ -240,6 +240,7 @@ private:
void HandleAsyncRedirectChannelToHttps();
nsresult AsyncRedirectChannelToHttps();
nsresult ContinueAsyncRedirectChannelToHttps(nsresult rv);
nsresult OpenRedirectChannel(nsresult rv);
/**
* A function that takes care of reading STS headers and enforcing STS