Bug 1277213 - Reset auth continuation state after dialog cancellation a=sylvestre
authorJan Horak <jhorak@redhat.com>
Mon, 29 Aug 2016 10:20:23 -0700
changeset 312201 d91fc76079e07f5e83d66f6891764df8329de2bc
parent 312200 10c9453407de40dd17d612f802da2fab94c161f4
child 312202 3e37ba5e08671794160306b1d8b30cfc7c448fec
push id213
push userkwierso@gmail.com
push dateMon, 29 Aug 2016 17:22:22 +0000
treeherdermozilla-esr45@fd5052e343df [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1277213
milestone45.3.1
Bug 1277213 - Reset auth continuation state after dialog cancellation a=sylvestre
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -1173,16 +1173,23 @@ NS_IMETHODIMP nsHttpChannelAuthProvider:
     if (!mAuthChannel)
         return NS_OK;
 
     if (userCancel) {
         if (!mRemainingChallenges.IsEmpty()) {
             // there are still some challenges to process, do so
             nsresult rv;
 
+            // Get rid of current continuationState to avoid reusing it in
+            // next challenges since it is no longer relevant.
+            if (mProxyAuth) {
+                NS_IF_RELEASE(mProxyAuthContinuationState);
+            } else {
+                NS_IF_RELEASE(mAuthContinuationState);
+            }
             nsAutoCString creds;
             rv = GetCredentials(mRemainingChallenges.get(), mProxyAuth, creds);
             if (NS_SUCCEEDED(rv)) {
                 // GetCredentials loaded the credentials from the cache or
                 // some other way in a synchronous manner, process those
                 // credentials now
                 mRemainingChallenges.Truncate();
                 return ContinueOnAuthAvailable(creds);