зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1861878: Remove network.ssl_tokens_cache_use_only_once pref r=necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D194426
This commit is contained in:
Родитель
d1de3a922c
Коммит
99c79d5698
|
@ -11915,12 +11915,6 @@
|
|||
value: 2
|
||||
mirror: always
|
||||
|
||||
# If true, only use the token once
|
||||
- name: network.ssl_tokens_cache_use_only_once
|
||||
type: RelaxedAtomicBool
|
||||
value: true
|
||||
mirror: always
|
||||
|
||||
# The maximum allowed length for a URL - 1MB default.
|
||||
- name: network.standard-url.max-length
|
||||
type: RelaxedAtomicUint32
|
||||
|
|
|
@ -395,12 +395,10 @@ nsresult SSLTokensCache::GetLocked(const nsACString& aKey,
|
|||
if (aTokenId) {
|
||||
*aTokenId = rec->mId;
|
||||
}
|
||||
if (StaticPrefs::network_ssl_tokens_cache_use_only_once()) {
|
||||
mCacheSize -= rec->Size();
|
||||
cacheEntry->RemoveWithId(rec->mId);
|
||||
if (cacheEntry->RecordCount() == 0) {
|
||||
mTokenCacheRecords.Remove(aKey);
|
||||
}
|
||||
mCacheSize -= rec->Size();
|
||||
cacheEntry->RemoveWithId(rec->mId);
|
||||
if (cacheEntry->RecordCount() == 0) {
|
||||
mTokenCacheRecords.Remove(aKey);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -69,27 +69,13 @@ TEST(TestTokensCache, SinglePut)
|
|||
{
|
||||
mozilla::net::SSLTokensCache::Clear();
|
||||
mozilla::Preferences::SetInt("network.ssl_tokens_cache_records_per_entry", 1);
|
||||
mozilla::Preferences::SetBool("network.ssl_tokens_cache_use_only_once",
|
||||
false);
|
||||
mozilla::Preferences::SetBool("network.ssl_tokens_cache_use_only_once", true);
|
||||
|
||||
putToken("anon:www.example.com:443"_ns, 100);
|
||||
nsTArray<uint8_t> result;
|
||||
mozilla::net::SessionCacheInfo unused;
|
||||
uint64_t id = 0;
|
||||
nsresult rv = mozilla::net::SSLTokensCache::Get("anon:www.example.com:443"_ns,
|
||||
result, unused, &id);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
ASSERT_EQ(result.Length(), (size_t)100);
|
||||
ASSERT_EQ(id, (uint64_t)1);
|
||||
rv = mozilla::net::SSLTokensCache::Get("anon:www.example.com:443"_ns, result,
|
||||
unused, &id);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
|
||||
mozilla::Preferences::SetBool("network.ssl_tokens_cache_use_only_once", true);
|
||||
// network.ssl_tokens_cache_use_only_once is true, so the record will be
|
||||
// removed after SSLTokensCache::Get below.
|
||||
rv = mozilla::net::SSLTokensCache::Get("anon:www.example.com:443"_ns, result,
|
||||
unused);
|
||||
result, unused);
|
||||
ASSERT_EQ(rv, NS_OK);
|
||||
rv = mozilla::net::SSLTokensCache::Get("anon:www.example.com:443"_ns, result,
|
||||
unused);
|
||||
|
|
Загрузка…
Ссылка в новой задаче