              trans = ent->mPendingQ[i];
  
              // When this transaction has already established a half-open
+@@ -927,6 +944,7 @@
+                               "something mutated pending queue from "
+                               "GetConnection()");
+         }
++        delete [] ind;
+         if (conn) {
+             LOG(("  dispatching pending transaction...\n"));
+ 
 @@ -1011,6 +1026,19 @@ nsHttpConnectionMgr::AtActiveConnectionLimit(nsConnectionEntry *ent, PRUint8 cap
          maxPersistConns = mMaxPersistConnsPerHost;
      }

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

-            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) {
