Bug 1337826 - Do not use sticky connection if it is pipeline. r=mcmanus a=gchang
authorDragana Damjanovic <dd.mozilla@gmail.com>
Tue, 14 Feb 2017 10:46:00 -0500
changeset 376440 09f5aa6b8913a6ba39d23f02a3016396024e1c64
parent 376439 e5daae0b3090976f617b894ac84bf72480792771
child 376441 ba0e8ae48b470aa661a2f3ec769cd0b88f9a8139
push id6996
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 20:48:21 +0000
treeherdermozilla-beta@d89512dab048 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, gchang
bugs1337826
milestone53.0a2
Bug 1337826 - Do not use sticky connection if it is pipeline. r=mcmanus a=gchang
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -6706,16 +6706,24 @@ nsHttpChannel::OnStopRequest(nsIRequest 
             LOG(("  transaction %p provides connection %p", mTransaction.get(), conn.get()));
             // This is so far a workaround to fix leak when reusing unpersistent
             // connection for authentication retry. See bug 459620 comment 4
             // for details.
             if (conn && !conn->IsPersistent()) {
                 LOG(("  connection is not persistent, not reusing it"));
                 conn = nullptr;
             }
+            // We do not use a sticky connection in case of a nsHttpPipeline as
+            // well (see bug 1337826). This is a quick fix, because
+            // nsHttpPipeline is turned off by default.
+            RefPtr<nsAHttpTransaction> tranConn = do_QueryObject(conn);
+            if (tranConn && tranConn->QueryPipeline()) {
+                LOG(("Do not use this connection, it is a nsHttpPipeline."));
+                conn = nullptr;
+            }
         }
 
         RefPtr<nsAHttpConnection> stickyConn;
         if (mCaps & NS_HTTP_STICKY_CONNECTION) {
             stickyConn = mTransaction->GetConnectionReference();
         }
 
         mTransferSize = mTransaction->GetTransferSize();