Bug 1689550 - Add a pref to disable 0RTT only for HTTP3 r=necko-reviewers,valentin

Differential Revision: https://phabricator.services.mozilla.com/D106560
This commit is contained in:
Dragana Damjanovic 2021-02-26 10:11:00 +00:00
Родитель 8a93c0d3bd
Коммит 1668a22b70
2 изменённых файлов: 9 добавлений и 2 удалений

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

@ -8916,6 +8916,11 @@
value: false
mirror: always
- name: network.http.http3.enable_0rtt
type: RelaxedAtomicBool
value: true
mirror: always
# When a h3 transaction is inserted in the pending queue, the time (ms) we wait
# to create a TCP backup connection.
- name: network.http.http3.backup_timer_delay

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

@ -186,7 +186,8 @@ nsresult Http3Session::Init(const nsHttpConnectionInfo* aConnInfo,
nsAutoCString peerId;
mSocketControl->GetPeerId(peerId);
nsTArray<uint8_t> token;
if (NS_SUCCEEDED(SSLTokensCache::Get(peerId, token))) {
if (StaticPrefs::network_http_http3_enable_0rtt() &&
NS_SUCCEEDED(SSLTokensCache::Get(peerId, token))) {
LOG(("Found a resumption token in the cache."));
mHttp3Connection->SetResumptionToken(token);
if (mHttp3Connection->IsZeroRtt()) {
@ -487,7 +488,8 @@ nsresult Http3Session::ProcessEvents() {
break;
case Http3Event::Tag::ResumptionToken: {
LOG(("Http3Session::ProcessEvents - ResumptionToken"));
if (!data.IsEmpty()) {
if (StaticPrefs::network_http_http3_enable_0rtt() &&
!data.IsEmpty()) {
LOG(("Got a resumption token"));
nsAutoCString peerId;
mSocketControl->GetPeerId(peerId);