bug 1056133 - add h2 to coalescing list r=hurley

This commit is contained in:
Patrick McManus 2014-08-20 10:41:14 -04:00
parent afff23ff06
commit 8bb10930d4

View File

@ -805,21 +805,19 @@ nsHttpConnectionMgr::GetSpdyPreferredEnt(nsConnectionEntry *aOriginalEntry)
return nullptr;
}
if (gHttpHandler->SpdyInfo()->ProtocolEnabled(0))
rv = sslSocketControl->JoinConnection(gHttpHandler->SpdyInfo()->VersionString[0],
aOriginalEntry->mConnInfo->GetHost(),
aOriginalEntry->mConnInfo->Port(),
&isJoined);
else
rv = NS_OK; /* simulate failed join */
// JoinConnection() may have failed due to spdy version level. Try the other
// level we support (if any)
if (NS_SUCCEEDED(rv) && !isJoined && gHttpHandler->SpdyInfo()->ProtocolEnabled(1)) {
rv = sslSocketControl->JoinConnection(gHttpHandler->SpdyInfo()->VersionString[1],
aOriginalEntry->mConnInfo->GetHost(),
aOriginalEntry->mConnInfo->Port(),
&isJoined);
// try all the spdy versions we support.
const SpdyInformation *info = gHttpHandler->SpdyInfo();
for (uint32_t index = SpdyInformation::kCount;
NS_SUCCEEDED(rv) && index > 0; --index) {
if (info->ProtocolEnabled(index - 1)) {
rv = sslSocketControl->JoinConnection(info->VersionString[index - 1],
aOriginalEntry->mConnInfo->GetHost(),
aOriginalEntry->mConnInfo->Port(),
&isJoined);
if (NS_SUCCEEDED(rv) && isJoined) {
break;
}
}
}
if (NS_FAILED(rv) || !isJoined) {