nsHttpConnection *conn = nsnull;   PRInt32 i; for (i=0; i<mIdleConnections.Count(); ++i) { conn = (nsHttpConnection *) mIdleConnections[i];  LOG(("comparing against idle connection [host=%s:%d]\n", conn->ConnectionInfo()->Host(), conn->ConnectionInfo()->Port()));     if (!conn->CanReuse()) { LOG(("dropping stale connection: [conn=%x]\n", conn)); mIdleConnections.RemoveElementAt(i); i--; NS_RELEASE(conn); } else if (conn->ConnectionInfo()->Equals(ci)) { LOG(("reusing connection [conn=%x]\n", conn)); mIdleConnections.RemoveElementAt(i); i--; break; } conn = nsnull; }  if (!conn) { LOG(("creating new connection...\n")); NS_NEWXPCOM(conn, nsHttpConnection); if (!conn) return NS_ERROR_OUT_OF_MEMORY; NS_ADDREF(conn);  rv = conn->Init(ci); if (NS_FAILED(rv)) goto failed; }  rv = conn->SetTransaction(trans); if (NS_FAILED(rv)) goto failed;  mActiveConnections.AppendElement(conn); return NS_OK;  failed: NS_RELEASE(conn); return rv; }
    nsresult InitiateTransaction(nsHttpTransaction *trans)    {        return mConnMgr->AddTransaction(trans);    }