Bug 1383748 - Fix SPDY while using proxy. r?mcmanus draft
authorWei-Cheng Pan <wpan@mozilla.com>
Thu, 27 Jul 2017 19:45:36 +0800
changeset 616697 452fb393760152868a00da65a2c1bb5741ecdbfc
parent 616205 f1693d664f8e8ee4c79801630c181c28095cad56
child 639570 0c6cf99c05ea64b07e55dc567b9011659a3e8c7d
push id70787
push userbmo:wpan@mozilla.com
push dateThu, 27 Jul 2017 11:55:12 +0000
reviewersmcmanus
bugs1383748
milestone56.0a1
Bug 1383748 - Fix SPDY while using proxy. r?mcmanus The SPDY status variable was overwrited by other function. Giving it a new meaningful name to prevent possible regression again. MozReview-Commit-ID: 4A98mKXXg7P
netwerk/protocol/http/nsHttpConnection.cpp
--- a/netwerk/protocol/http/nsHttpConnection.cpp
+++ b/netwerk/protocol/http/nsHttpConnection.cpp
@@ -282,48 +282,49 @@ nsHttpConnection::StartSpdy(uint8_t spdy
     // a server goaway was generated).
     mIsReused = true;
 
     // If mTransaction is a muxed object it might represent
     // several requests. If so, we need to unpack that and
     // pack them all into a new spdy session.
 
     nsTArray<RefPtr<nsAHttpTransaction> > list;
-    nsresult rv = NS_OK;
+    nsresult status = NS_OK;
     if (!mDid0RTTSpdy) {
-        rv = TryTakeSubTransactions(list);
+        status = TryTakeSubTransactions(list);
 
-        if (NS_FAILED(rv) && rv != NS_ERROR_NOT_IMPLEMENTED) {
+        if (NS_FAILED(status) && status != NS_ERROR_NOT_IMPLEMENTED) {
             return;
         }
     }
 
     if (NeedSpdyTunnel()) {
         LOG3(("nsHttpConnection::StartSpdy %p Connecting To a HTTP/2 "
               "Proxy and Need Connect", this));
         MOZ_ASSERT(mProxyConnectStream);
 
         mProxyConnectStream = nullptr;
         mCompletedProxyConnect = true;
         mProxyConnectInProgress = false;
     }
 
+    nsresult rv = NS_OK;
     bool spdyProxy = mConnInfo->UsingHttpsProxy() && !mTLSFilter;
     if (spdyProxy) {
         RefPtr<nsHttpConnectionInfo> wildCardProxyCi;
         rv = mConnInfo->CreateWildCard(getter_AddRefs(wildCardProxyCi));
         MOZ_ASSERT(NS_SUCCEEDED(rv));
         gHttpHandler->ConnMgr()->MoveToWildCardConnEntry(mConnInfo,
                                                          wildCardProxyCi, this);
         mConnInfo = wildCardProxyCi;
         MOZ_DIAGNOSTIC_ASSERT(mConnInfo);
     }
 
     if (!mDid0RTTSpdy) {
-        rv = MoveTransactionsToSpdy(rv, list);
+        rv = MoveTransactionsToSpdy(status, list);
         if (NS_FAILED(rv)) {
             return;
         }
     }
 
     // Disable TCP Keepalives - use SPDY ping instead.
     rv = DisableTCPKeepalives();
     if (NS_FAILED(rv)) {