Bug 1360574 - Backout original fix to bug 1346392 r?mcmanus draft
authorNicholas Hurley <hurley@mozilla.com>
Thu, 11 May 2017 10:20:14 -0700
changeset 576952 7b9e264691db03ffbc52a86799196251c69df55d
parent 576334 3b96f277325747fe668ca8cd896d2f581238e4ee
child 576953 24bb9c226cbdd582c1ab4ad9fa41065ca8846129
child 576955 142a87175d65f0871b36a38364aa9bd223ab3431
child 576992 c36a34d108778debd2df237d166bed286aed3063
child 577114 a21dac86ab16b0e88dba68fe7589ac559cac09a7
push id58544
push userbmo:hurley@mozilla.com
push dateFri, 12 May 2017 14:42:35 +0000
reviewersmcmanus
bugs1360574, 1346392
milestone55.0a1
Bug 1360574 - Backout original fix to bug 1346392 r?mcmanus 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
@@ -5652,35 +5652,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
@@ -112,17 +112,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
@@ -825,20 +825,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
@@ -1821,21 +1821,16 @@ void
 nsHttpTransaction::CheckForStickyAuthScheme()
 {
   LOG(("nsHttpTransaction::CheckForStickyAuthScheme this=%p", this));
 
   MOZ_ASSERT(mHaveAllHeaders);
   MOZ_ASSERT(mResponseHead);
   MOZ_ASSERT(OnSocketThread(), "not on socket thread");
 
-  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
@@ -130,18 +130,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;
@@ -211,16 +209,17 @@ private:
     static MOZ_MUST_USE 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.
      */
     [must_use] void closeStickyConnection();
 
     /**
-     * Tells the channel to not use SPDY-like protocols, since this will be
-     * using connection-oriented auth.
-     */
-    [must_use] 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);
 };