388523 make sure to call OnStartRequest even when we have a pending auth retry and the channel has been cancelled in the meantime r+sr=bz
authorcbiesinger@gmx.at
Tue, 07 Aug 2007 13:09:25 -0700
changeset 4357 a926389bddaa5a9f42443ebde2e64c3a512917dd
parent 4356 83b73ae4ccb59aa03741b7451e61b805952b6365
child 4358 a789cf17ca546f5655b61b191788fbfbd16cd941
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs388523
milestone1.9a8pre
388523 make sure to call OnStartRequest even when we have a pending auth retry and the channel has been cancelled in the meantime r+sr=bz
netwerk/protocol/http/src/nsHttpChannel.cpp
--- a/netwerk/protocol/http/src/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/src/nsHttpChannel.cpp
@@ -4317,16 +4317,25 @@ nsHttpChannel::OnStopRequest(nsIRequest 
         // handle auth retry...
         if (authRetry) {
             mAuthRetryPending = PR_FALSE;
             status = DoAuthRetry(conn);
             if (NS_SUCCEEDED(status))
                 return NS_OK;
         }
 
+        // If DoAuthRetry failed, or if we have been cancelled since showing
+        // the auth. dialog, then we need to send OnStartRequest now
+        if (authRetry || (mAuthRetryPending && NS_FAILED(status))) {
+            NS_ASSERTION(NS_FAILED(status), "should have a failure code here");
+            // NOTE: since we have a failure status, we can ignore the return
+            // value from onStartRequest.
+            mListener->OnStartRequest(this, mListenerContext);
+        }
+
         // if this transaction has been replaced, then bail.
         if (mTransactionReplaced)
             return NS_OK;
     }
 
     mIsPending = PR_FALSE;
     mStatus = status;