Bug 1881183 - Migrate network_http_max_response_header_size to static prefs, a=RyanVM

Original Revision: https://phabricator.services.mozilla.com/D205233

Differential Revision: https://phabricator.services.mozilla.com/D206698
This commit is contained in:
Kershaw Chang 2024-04-05 12:26:46 +00:00
parent c9a796d5ff
commit c9f3fad80a
5 changed files with 7 additions and 18 deletions

View File

@ -11669,6 +11669,12 @@
value: 10
mirror: always
# Max size, in bytes, for received HTTP response header.
- name: network.http.max_response_header_size
type: RelaxedAtomicUint32
value: 393216
mirror: always
# This preference, if true, causes all UTF-8 domain names to be normalized to
# punycode. The intention is to allow UTF-8 domain names as input, but never
# generate them from punycode.

View File

@ -1316,9 +1316,6 @@ pref("network.http.enforce-framing.http1", false); // should be named "strict"
pref("network.http.enforce-framing.soft", true);
pref("network.http.enforce-framing.strict_chunked_encoding", true);
// Max size, in bytes, for received HTTP response header.
pref("network.http.max_response_header_size", 393216);
// The ratio of the transaction count for the focused window and the count of
// all available active connections.
pref("network.http.focused_window_transaction_ratio", "0.9");

View File

@ -1440,13 +1440,6 @@ void nsHttpHandler::PrefsChanged(const char* pref) {
}
}
if (PREF_CHANGED(HTTP_PREF("max_response_header_size"))) {
rv = Preferences::GetInt(HTTP_PREF("max_response_header_size"), &val);
if (NS_SUCCEEDED(rv)) {
mMaxHttpResponseHeaderSize = val;
}
}
if (PREF_CHANGED(HTTP_PREF("throttle.enable"))) {
rv = Preferences::GetBool(HTTP_PREF("throttle.enable"), &mThrottleEnabled);
if (NS_SUCCEEDED(rv) && mConnMgr) {

View File

@ -447,10 +447,6 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
return (uint16_t)mHttp3MaxBlockedStreams;
}
uint32_t MaxHttpResponseHeaderSize() const {
return mMaxHttpResponseHeaderSize;
}
const nsCString& Http3QlogDir();
float FocusedWindowTransactionRatio() const {
@ -730,9 +726,6 @@ class nsHttpHandler final : public nsIHttpProtocolHandler,
nsCString mHttp3QlogDir;
// The max size (in bytes) for received Http response header.
uint32_t mMaxHttpResponseHeaderSize{393216};
// The ratio for dispatching transactions from the focused window.
float mFocusedWindowTransactionRatio{0.9f};

View File

@ -2477,7 +2477,7 @@ nsresult nsHttpTransaction::ProcessData(char* buf, uint32_t count,
mCurrentHttpResponseHeaderSize += bytesConsumed;
if (mCurrentHttpResponseHeaderSize >
gHttpHandler->MaxHttpResponseHeaderSize()) {
StaticPrefs::network_http_max_response_header_size()) {
LOG(("nsHttpTransaction %p The response header exceeds the limit.\n",
this));
return NS_ERROR_FILE_TOO_BIG;