From 7086937608aae26c4a51f8c071338e57a0873a5f Mon Sep 17 00:00:00 2001 From: Valentin Gosu Date: Thu, 28 Jan 2021 16:59:09 +0000 Subject: [PATCH] Bug 1689208 - Don't race for LINK_TYPE_UNKNOWN on Android r=necko-reviewers,kershaw Depends on D103305 Differential Revision: https://phabricator.services.mozilla.com/D103306 --- netwerk/protocol/http/nsHttpChannel.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp index e7cc71306c20..b68286c5a6c8 100644 --- a/netwerk/protocol/http/nsHttpChannel.cpp +++ b/netwerk/protocol/http/nsHttpChannel.cpp @@ -9693,8 +9693,11 @@ nsresult nsHttpChannel::MaybeRaceCacheWithNetwork() { rv = netLinkSvc->GetLinkType(&linkType); NS_ENSURE_SUCCESS(rv, rv); - if (!(linkType == nsINetworkLinkService::LINK_TYPE_UNKNOWN || - linkType == nsINetworkLinkService::LINK_TYPE_ETHERNET || + if (!(linkType == nsINetworkLinkService::LINK_TYPE_ETHERNET || +#ifndef MOZ_WIDGET_ANDROID + // On Android we don't assume an unknown link type is unmetered + linkType == nsINetworkLinkService::LINK_TYPE_UNKNOWN || +#endif linkType == nsINetworkLinkService::LINK_TYPE_USB || linkType == nsINetworkLinkService::LINK_TYPE_WIFI)) { return NS_OK;