Commit c9f3fad8 authored by Kershaw Chang's avatar Kershaw Chang
Browse files

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

parent c9a796d5
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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.
+0 −3
Original line number Diff line number Diff line
@@ -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");
+0 −7
Original line number Diff line number Diff line
@@ -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) {
+0 −7
Original line number Diff line number Diff line
@@ -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};

+1 −1
Original line number Diff line number Diff line
@@ -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;