Bug 1277213 - Reset auth continuation state after dialog cancellation a=lizzard
authorJan Horak <jhorak@redhat.com>
Wed, 10 Aug 2016 10:51:20 -0700
changeset 340278 52ad6d77d5e4f18c0200217638da3fd4380f25e2
parent 340277 ff14a84489e5e5e0726adc8a8bd393b69127edf9
child 340279 39ad687dbbae69ef71de90a827b6b35337c826a5
push id6284
push userkwierso@gmail.com
push dateWed, 10 Aug 2016 17:55:00 +0000
treeherdermozilla-beta@39ad687dbbae [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslizzard
bugs1277213
milestone49.0
Bug 1277213 - Reset auth continuation state after dialog cancellation a=lizzard
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -1218,16 +1218,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);