[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [torbrowser/maint-2.4] Fix the depth check in the pipeline patch.



commit e405e56d178b5d456278921050d4e7ae8e21e51f
Author: Mike Perry <mikeperry-git@xxxxxxxxxx>
Date:   Thu Apr 11 19:43:43 2013 -0700

    Fix the depth check in the pipeline patch.
    
    Also improve log message.
---
 ...ize-HTTP-request-order-and-pipeline-depth.patch |   47 ++++++++++----------
 1 files changed, 24 insertions(+), 23 deletions(-)

diff --git a/src/current-patches/firefox/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch b/src/current-patches/firefox/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
index f7dab44..a82e429 100644
--- a/src/current-patches/firefox/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
+++ b/src/current-patches/firefox/0017-Randomize-HTTP-request-order-and-pipeline-depth.patch
@@ -1,4 +1,4 @@
-From 468117ab9f414332429406e588ad81fa7b3c72fa Mon Sep 17 00:00:00 2001
+From 6043bc14b28d49618e7882707c56b2fac4ada2a9 Mon Sep 17 00:00:00 2001
 From: Mike Perry <mikeperry-git@xxxxxxxxxxxxxx>
 Date: Tue, 4 Dec 2012 17:38:51 -0800
 Subject: [PATCH 17/28] Randomize HTTP request order and pipeline depth.
@@ -36,15 +36,15 @@ request representation that will allow more requests to be packed inside Tor
 cells. If you have interest in evaluating SPDY in a study of Website Traffic
 Fingerprinting, please contact me.
 ---
- netwerk/protocol/http/nsHttpConnectionMgr.cpp |  297 +++++++++++++++++--------
+ netwerk/protocol/http/nsHttpConnectionMgr.cpp |  298 +++++++++++++++++--------
  netwerk/protocol/http/nsHttpConnectionMgr.h   |   15 +-
  netwerk/protocol/http/nsHttpHandler.h         |    2 +
- netwerk/protocol/http/nsHttpPipeline.cpp      |   62 +++++-
+ netwerk/protocol/http/nsHttpPipeline.cpp      |   62 ++++-
  netwerk/protocol/http/nsHttpPipeline.h        |    3 +
- 5 files changed, 281 insertions(+), 98 deletions(-)
+ 5 files changed, 282 insertions(+), 98 deletions(-)
 
 diff --git a/netwerk/protocol/http/nsHttpConnectionMgr.cpp b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
-index 133c301..81ea113 100644
+index 133c301..69de433 100644
 --- a/netwerk/protocol/http/nsHttpConnectionMgr.cpp
 +++ b/netwerk/protocol/http/nsHttpConnectionMgr.cpp
 @@ -20,6 +20,8 @@
@@ -204,11 +204,11 @@ index 133c301..81ea113 100644
 +        // limit to allow us to try to get there. Don't give
 +        // too much slack, though, or we'll tend to have
 +        // request packages of the same size when we have
-+        // many content elements appear.
-+        if (maxdepth <=
-+            (pipelineDepth -
-+               PR_MIN(mMaxOptimisticPipelinedRequests,
-+                      requestLen + allClasses)))
++        // many content elements appear at once.
++        if (maxdepth +
++              PR_MIN(mMaxOptimisticPipelinedRequests,
++                     requestLen + allClasses)
++              <= pipelineDepth)
              continue;
  
 -        if (!bestConn || (connLength < bestConnLength)) {
@@ -254,22 +254,23 @@ index 133c301..81ea113 100644
  
      activeTrans = bestConn->Transaction();
      nsresult rv = activeTrans->AddTransaction(trans);
-@@ -1343,6 +1431,14 @@ nsHttpConnectionMgr::AddToShortestPipeline(nsConnectionEntry *ent,
+@@ -1343,6 +1431,15 @@ nsHttpConnectionMgr::AddToShortestPipeline(nsConnectionEntry *ent,
      LOG(("   scheduling trans %p on pipeline at position %d\n",
           trans, trans->PipelinePosition()));
  
 +#ifdef WTF_DEBUG
 +    pipeline = activeTrans->QueryPipeline();
-+    fprintf(stderr, "WTF-depth: Added trans to %s of %d/%d/%d/%d pipelines. Request len %d/%d for %s\n",
++    fprintf(stderr,
++            "WTF-depth: Added trans to %s of %d/%d/%d/%d pipelines. Request len %d/%d/%d for %s\n",
 +            type, bestConns.Length(), betterConns.Length(), validConns.Length(),
 +            numPipelines, pipeline->RequestDepth(), activeTrans->PipelineDepth(),
-+            ent->mConnInfo->Host());
++            maxdepth, ent->mConnInfo->Host());
 +#endif
 +
      if ((ent->PipelineState() == PS_YELLOW) && (trans->PipelinePosition() > 1))
          ent->SetYellowConnection(bestConn);
      return true;
-@@ -1403,26 +1499,12 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
+@@ -1403,26 +1500,12 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
      nsHttpTransaction::Classifier classification = trans->Classification();
      uint8_t caps = trans->Caps();
  
@@ -298,7 +299,7 @@ index 133c301..81ea113 100644
      // step 0
      // look for existing spdy connection - that's always best because it is
      // essentially pipelining without head of line blocking
-@@ -1436,20 +1518,27 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
+@@ -1436,20 +1519,27 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
          }
      }
  
@@ -338,7 +339,7 @@ index 133c301..81ea113 100644
          nsRefPtr<nsHttpConnection> conn;
          while (!conn && (ent->mIdleConns.Length() > 0)) {
              conn = ent->mIdleConns[0];
-@@ -1483,21 +1572,8 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
+@@ -1483,21 +1573,8 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
          }
      }
  
@@ -362,7 +363,7 @@ index 133c301..81ea113 100644
          nsresult rv = MakeNewConnection(ent, trans);
          if (NS_SUCCEEDED(rv)) {
              // this function returns NOT_AVAILABLE for asynchronous connects
-@@ -1510,17 +1586,16 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
+@@ -1510,17 +1587,16 @@ nsHttpConnectionMgr::TryDispatchTransaction(nsConnectionEntry *ent,
              return rv;
          }
      }
@@ -389,7 +390,7 @@ index 133c301..81ea113 100644
      return NS_ERROR_NOT_AVAILABLE;                /* queue it */
  }
  
-@@ -1590,10 +1665,20 @@ nsHttpConnectionMgr::DispatchAbstractTransaction(nsConnectionEntry *ent,
+@@ -1590,10 +1666,20 @@ nsHttpConnectionMgr::DispatchAbstractTransaction(nsConnectionEntry *ent,
          if (!NS_SUCCEEDED(rv))
              return rv;
          transaction = pipeline;
@@ -410,7 +411,7 @@ index 133c301..81ea113 100644
      }
  
      nsRefPtr<nsConnectionHandle> handle = new nsConnectionHandle(conn);
-@@ -1692,27 +1777,15 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
+@@ -1692,27 +1778,15 @@ nsHttpConnectionMgr::ProcessNewTransaction(nsHttpTransaction *trans)
                            "Sticky Connection Not In Active List");
          trans->SetConnection(nullptr);
          rv = DispatchTransaction(ent, trans, conn);
@@ -441,7 +442,7 @@ index 133c301..81ea113 100644
  }
  
  
-@@ -2311,13 +2384,37 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, void *param)
+@@ -2311,13 +2385,37 @@ nsHttpConnectionMgr::OnMsgSpeculativeConnect(int32_t, void *param)
      if (preferredEntry)
          ent = preferredEntry;
  
@@ -480,7 +481,7 @@ index 133c301..81ea113 100644
  nsHttpConnectionMgr::nsConnectionHandle::IsPersistent()
  {
      return mConn->IsPersistent();
-@@ -2852,9 +2949,13 @@ nsConnectionEntry::nsConnectionEntry(nsHttpConnectionInfo *ci)
+@@ -2852,9 +2950,13 @@ nsConnectionEntry::nsConnectionEntry(nsHttpConnectionInfo *ci)
  {
      NS_ADDREF(mConnInfo);
      if (gHttpHandler->GetPipelineAggressive()) {
@@ -495,7 +496,7 @@ index 133c301..81ea113 100644
      mInitialGreenDepth = mGreenDepth;
      memset(mPipeliningClassPenalty, 0, sizeof(int16_t) * nsAHttpTransaction::CLASS_MAX);
  }
-@@ -2892,8 +2993,9 @@ nsConnectionEntry::OnPipelineFeedbackInfo(
+@@ -2892,8 +2994,9 @@ nsConnectionEntry::OnPipelineFeedbackInfo(
          LOG(("Transaction completed at pipeline depth of %d. Host = %s\n",
               depth, mConnInfo->Host()));
  
@@ -507,7 +508,7 @@ index 133c301..81ea113 100644
      }
  
      nsAHttpTransaction::Classifier classification;
-@@ -2921,6 +3023,11 @@ nsConnectionEntry::OnPipelineFeedbackInfo(
+@@ -2921,6 +3024,11 @@ nsConnectionEntry::OnPipelineFeedbackInfo(
                   mPipelineState, mConnInfo->Host()));
              mPipelineState = PS_RED;
              mPipeliningPenalty = 0;

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits