Bug 1360574 - Backout original fix to bug 1346392. r=mcmanus, a=gchang
authorNicholas Hurley <hurley@mozilla.com>
Thu, 11 May 2017 10:20:14 -0700
changeset 396281 61f92598393ef97d7548fb8ecf8549877adf93d1
parent 396280 121ef7d3dcaea47b7b7ad0063bae02493ec0584e
child 396282 eeeee18148df4e3a4b701aeffcbf490945d99267
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, gchang
bugs1360574, 1346392
milestone54.0
Bug 1360574 - Backout original fix to bug 1346392. r=mcmanus, a=gchang MozReview-Commit-ID: 1ljoiCXciRq
netwerk/protocol/http/nsHttpChannel.cpp
netwerk/protocol/http/nsHttpChannel.h
netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
netwerk/protocol/http/nsHttpTransaction.cpp
netwerk/protocol/http/nsHttpTransaction.h
netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -5539,35 +5539,16 @@ NS_IMETHODIMP nsHttpChannel::CloseSticky
     }
 
     // This turns the IsPersistent() indicator on the connection to false,
     // and makes us throw it away in OnStopRequest.
     conn->DontReuse();
     return NS_OK;
 }
 
-NS_IMETHODIMP nsHttpChannel::ForceNoSpdy()
-{
-    LOG(("nsHttpChannel::ForceNoSpdy this=%p", this));
-
-    MOZ_ASSERT(mTransaction);
-    if (!mTransaction) {
-        return NS_ERROR_UNEXPECTED;
-    }
-
-    mAllowSpdy = 0;
-    mCaps |= NS_HTTP_DISALLOW_SPDY;
-
-    if (!(mTransaction->Caps() & NS_HTTP_DISALLOW_SPDY)) {
-        mTransaction->DisableSpdy();
-    }
-
-    return NS_OK;
-}
-
 NS_IMETHODIMP nsHttpChannel::ConnectionRestartable(bool aRestartable)
 {
     LOG(("nsHttpChannel::ConnectionRestartable this=%p, restartable=%d",
          this, aRestartable));
     mAuthConnectionRestartable = aRestartable;
     return NS_OK;
 }
 
--- a/netwerk/protocol/http/nsHttpChannel.h
+++ b/netwerk/protocol/http/nsHttpChannel.h
@@ -111,17 +111,16 @@ public:
     NS_IMETHOD GetServerResponseHeader(nsACString & aServerResponseHeader) override;
     NS_IMETHOD GetProxyChallenges(nsACString & aChallenges) override;
     NS_IMETHOD GetWWWChallenges(nsACString & aChallenges) override;
     NS_IMETHOD SetProxyCredentials(const nsACString & aCredentials) override;
     NS_IMETHOD SetWWWCredentials(const nsACString & aCredentials) override;
     NS_IMETHOD OnAuthAvailable() override;
     NS_IMETHOD OnAuthCancelled(bool userCancel) override;
     NS_IMETHOD CloseStickyConnection() override;
-    NS_IMETHOD ForceNoSpdy() override;
     NS_IMETHOD ConnectionRestartable(bool) override;
     // Functions we implement from nsIHttpAuthenticableChannel but are
     // declared in HttpBaseChannel must be implemented in this class. We
     // just call the HttpBaseChannel:: impls.
     NS_IMETHOD GetLoadFlags(nsLoadFlags *aLoadFlags) override;
     NS_IMETHOD GetURI(nsIURI **aURI) override;
     NS_IMETHOD GetNotificationCallbacks(nsIInterfaceRequestor **aCallbacks) override;
     NS_IMETHOD GetLoadGroup(nsILoadGroup **aLoadGroup) override;
--- a/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
+++ b/netwerk/protocol/http/nsHttpChannelAuthProvider.cpp
@@ -816,20 +816,16 @@ nsHttpChannelAuthProvider::GetCredential
             // - if we didn't clear the proxy identity, it would be considered
             //   as non-valid and we would ask the user again ; clearing it forces
             //   use of the cached identity and not asking the user again
             mProxyIdent.Clear();
         }
     }
 
     mConnectionBased = !!(authFlags & nsIHttpAuthenticator::CONNECTION_BASED);
-    if (mConnectionBased) {
-        rv = mAuthChannel->ForceNoSpdy();
-        MOZ_ASSERT(NS_SUCCEEDED(rv));
-    }
 
     // It's legal if the peer closes the connection after the first 401/7.
     // Making the connection sticky will prevent its restart giving the user
     // a 'network reset' error every time.  Hence, we mark the connection
     // as restartable.
     mAuthChannel->ConnectionRestartable(mConnectionBased && !authAtProgress);
 
     if (identityInvalid) {
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@@ -1784,21 +1784,16 @@ void
 nsHttpTransaction::CheckForStickyAuthScheme()
 {
   LOG(("nsHttpTransaction::CheckForStickyAuthScheme this=%p", this));
 
   MOZ_ASSERT(mHaveAllHeaders);
   MOZ_ASSERT(mResponseHead);
   MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
 
-  if (mClosed) {
-      LOG(("  closed, not checking"));
-      return;
-  }
-
   CheckForStickyAuthSchemeAt(nsHttp::WWW_Authenticate);
   CheckForStickyAuthSchemeAt(nsHttp::Proxy_Authenticate);
 }
 
 void
 nsHttpTransaction::CheckForStickyAuthSchemeAt(nsHttpAtom const& header)
 {
   if (mCaps & NS_HTTP_STICKY_CONNECTION) {
--- a/netwerk/protocol/http/nsHttpTransaction.h
+++ b/netwerk/protocol/http/nsHttpTransaction.h
@@ -126,18 +126,16 @@ public:
     const TimeStamp GetPendingTime() { return mPendingTime; }
 
     // overload of nsAHttpTransaction::RequestContext()
     nsIRequestContext *RequestContext() override { return mRequestContext.get(); }
     void SetRequestContext(nsIRequestContext *aRequestContext);
     void DispatchedAsBlocking();
     void RemoveDispatchedAsBlocking();
 
-    void DisableSpdy() override;
-
     nsHttpTransaction *QueryHttpTransaction() override { return this; }
 
     Http2PushedStream *GetPushedStream() { return mPushedStream; }
     Http2PushedStream *TakePushedStream()
     {
         Http2PushedStream *r = mPushedStream;
         mPushedStream = nullptr;
         return r;
@@ -188,16 +186,17 @@ private:
                                        uint32_t, uint32_t, uint32_t *);
     static nsresult WritePipeSegment(nsIOutputStream *, void *, char *,
                                      uint32_t, uint32_t, uint32_t *);
 
     bool TimingEnabled() const { return mCaps & NS_HTTP_TIMING_ENABLED; }
 
     bool ResponseTimeoutEnabled() const final;
 
+    void DisableSpdy() override;
     void ReuseConnectionOnRestartOK(bool reuseOk) override { mReuseOnRestart = reuseOk; }
 
     // Called right after we parsed the response head.  Checks for connection based
     // authentication schemes in reponse headers for WWW and Proxy authentication.
     // If such is found in any of them, NS_HTTP_STICKY_CONNECTION is set in mCaps.
     // We need the sticky flag be set early to keep the connection from very start
     // of the authentication process.
     void CheckForStickyAuthScheme();
--- a/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
+++ b/netwerk/protocol/http/nsIHttpAuthenticableChannel.idl
@@ -109,20 +109,14 @@ interface nsIHttpAuthenticableChannel : 
     /**
      * Tells the channel to drop and close any sticky connection, since this
      * connection oriented schema cannot be negotiated second time on
      * the same connection.
      */
     void closeStickyConnection();
 
     /**
-     * Tells the channel to not use SPDY-like protocols, since this will be
-     * using connection-oriented auth.
-     */
-    void forceNoSpdy();
-
-    /**
      * Tells the channel to mark the connection as allowed to restart on
      * authentication retry.  This is allowed when the request is a start
      * of a new authentication round.
      */
     void connectionRestartable(in boolean restartable);
 };