Bug 1655843 - Prefer HTTP3 connections in the connection pool. r=michal,necko-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D85843
This commit is contained in:
Dragana Damjanovic 2020-08-04 12:41:54 +00:00
Родитель 1c2de69532
Коммит 7c336961ad
1 изменённых файлов: 16 добавлений и 7 удалений

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

@ -839,13 +839,22 @@ void nsHttpConnectionMgr::UpdateCoalescingForNewConn(
HttpConnectionBase* existingConn =
FindCoalescableConnection(ent, true, false);
if (existingConn) {
LOG(
("UpdateCoalescingForNewConn() found existing active conn that could "
"have served newConn "
"graceful close of newConn=%p to migrate to existingConn %p\n",
newConn, existingConn));
newConn->DontReuse();
return;
// Prefer http3 connection.
if (newConn->UsingHttp3() && existingConn->UsingSpdy()) {
LOG(
("UpdateCoalescingForNewConn() found existing active H2 conn that "
"could have served newConn, but new connection is H3, therefore "
"close the H2 conncetion"));
existingConn->DontReuse();
} else {
LOG(
("UpdateCoalescingForNewConn() found existing active conn that could "
"have served newConn "
"graceful close of newConn=%p to migrate to existingConn %p\n",
newConn, existingConn));
newConn->DontReuse();
return;
}
}
// This connection might go into the mCoalescingHash for new transactions to