Back out 96a806212cac (bug 865314) for apparently causing fairly frequent failures in test_spdy.js

This commit is contained in:
Phil Ringnalda 2013-04-24 23:45:40 -07:00
Родитель c1591385ae
Коммит 37a09dd732
3 изменённых файлов: 16 добавлений и 27 удалений

Просмотреть файл

@ -68,8 +68,8 @@ nsHttpConnectionMgr::PrintDiagnosticsCB(const nsACString &key,
ent->mHalfOpens.Length());
self->mLogData.AppendPrintf(" Coalescing Key = %s\n",
ent->mCoalescingKey.get());
self->mLogData.AppendPrintf(" Spdy using = %d, preferred = %d\n",
ent->mUsingSpdy, ent->mSpdyPreferred);
self->mLogData.AppendPrintf(" Spdy using = %d, tested = %d, preferred = %d\n",
ent->mUsingSpdy, ent->mTestedSpdy, ent->mSpdyPreferred);
self->mLogData.AppendPrintf(" pipelinestate = %d penalty = %d\n",
ent->mPipelineState, ent->mPipeliningPenalty);
for (i = 0; i < nsAHttpTransaction::CLASS_MAX; ++i) {

Просмотреть файл

@ -521,6 +521,8 @@ nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection *conn,
if (!ent)
return;
ent->mTestedSpdy = true;
if (!usingSpdy)
return;
@ -562,28 +564,7 @@ nsHttpConnectionMgr::ReportSpdyConnection(nsHttpConnection *conn,
// normally, but then it will go away and future connections will be
// coalesced through the preferred entry.
LOG(("ReportSpdyConnection shutting down connection because "
"of desharding\n"));
conn->DontReuse();
}
else if (ent->mActiveConns.Length() > 1) {
// this is a new connection to an established preferred spdy host.
// if there is more than 1 live and established spdy connection (e.g.
// some could still be handshaking, shutting down, etc..) then close
// this one down after any transactions that are on it are complete.
// This probably happened due to the parallel connection algorithm
// that is used only before the host is known to speak spdy.
for (uint32_t index = 0; index < ent->mActiveConns.Length(); ++index) {
nsHttpConnection *otherConn = ent->mActiveConns[index];
if (otherConn == conn)
continue;
if (conn->CanDirectlyActivate()) {
LOG(("ReportSpdyConnection shutting down connection because more "
"than 1 active spdy connection is live to this host\n"));
conn->DontReuse();
break;
}
}
conn->DontReuse();
}
PostEvent(&nsHttpConnectionMgr::OnMsgProcessAllSpdyPendingQ);
@ -970,8 +951,9 @@ nsHttpConnectionMgr::PruneDeadConnectionsCB(const nsACString &key,
ent->mActiveConns.Length() == 0 &&
ent->mHalfOpens.Length() == 0 &&
ent->mPendingQ.Length() == 0 &&
!ent->mUsingSpdy &&
self->mCT.Count() > 300) {
((!ent->mTestedSpdy && !ent->mUsingSpdy) ||
!gHttpHandler->IsSpdyEnabled() ||
self->mCT.Count() > 300)) {
LOG((" removing empty connection entry\n"));
return PL_DHASH_REMOVE;
}
@ -1307,7 +1289,7 @@ nsHttpConnectionMgr::RestrictConnections(nsConnectionEntry *ent)
bool doRestrict = ent->mConnInfo->UsingSSL() &&
gHttpHandler->IsSpdyEnabled() &&
ent->mUsingSpdy &&
(!ent->mTestedSpdy || ent->mUsingSpdy) &&
(ent->mHalfOpens.Length() || ent->mActiveConns.Length());
// If there are no restrictions, we are done
@ -3122,6 +3104,7 @@ nsConnectionEntry::nsConnectionEntry(nsHttpConnectionInfo *ci)
, mPipeliningPenalty(0)
, mSpdyCWND(0)
, mUsingSpdy(false)
, mTestedSpdy(false)
, mSpdyPreferred(false)
, mPreferIPv4(false)
, mPreferIPv6(false)

Просмотреть файл

@ -358,6 +358,12 @@ private:
// connection is currently using spdy.
bool mUsingSpdy;
// mTestedSpdy is set after NPN negotiation has occurred and we know
// with confidence whether a host speaks spdy or not (which is reflected
// in mUsingSpdy). Before mTestedSpdy is set, handshake parallelism is
// minimized so that we can multiplex on a single spdy connection.
bool mTestedSpdy;
bool mSpdyPreferred;
// Flags to remember our happy-eyeballs decision.