                  nsHttpTransaction *trans = ent->mPendingQ[i];
                  if (trans->Caps() & NS_HTTP_ALLOW_PIPELINING) {
                      pipeline->AddTransaction(trans);
+@@ -365,6 +375,8 @@
+                     break;
+                 }
+             }
++
++            delete [] ind;
+         }
+     }
+ }
 @@ -898,12 +908,17 @@ nsHttpConnectionMgr::ProcessPendingQForEntry(nsConnectionEntry *ent)
  
      ProcessSpdyPendingQ(ent);

             trans = ent->mPendingQ[i];
 
             // When this transaction has already established a half-open
@@ -1011,6 +1026,19 @@ nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry *ent, PRUint8 cap
         maxPersistConns = mMaxPersistConnsPerHost;
     }

-            PRInt32 i, count = ent->mPendingQ.Length();
-            for (i=0; i<count; ++i) {
+            PRInt32 i, h, count = ent->mPendingQ.Length();
+            PRInt32* ind = new PRInt32[count];
+            ShuffleRequestOrder((PRUint32*)ind, (PRUint32)count);
+       
+            for (h=0; h<count; ++h) {
