                  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;
     }

         nsHttpConnection *conn = nsnull;
-        for (i = 0; i < count; ++i) {
+
+        PRUInt32* ind = new PRUInt32[count];
+        ShuffleRequestOrder(ind, count);
+       
+        for (h=0; h<count; ++h) {
