Copy-buffer settings do not reach the HTTP/1 header-rewriting path
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- rust
- 領域
- backend, networking
調査の方向性
src/http_proxy.rs の read_header_block、copy_exact、tunnel/read-to-close のコピー、および carry-buffer のアロケーションから始めます。#36 の方向別設定が rewrite pumps にどのように到達するかを追跡し、parser の境界とコピーサイズの決定を分離したままにします。また、アプローチを選択する前に #37 も確認します。rewrite ルートが設定されたコピーサイズを尊重し、parser の制限が固定されたままで、接続ごとのメモリに関するドキュメントまたは根拠が更新されれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
The readBufferSize / clientReadBufferSize / upstreamReadBufferSize settings introduced in #36 govern the plain proxying path only. A route that injects HTTP headers — sourceAddressHeader: 'xForwardedFor', or forwardFingerprint: 'ja3'|'ja4' under any mode other than proxyProtocolV2 — takes http_proxy::proxy_http1_rewriting instead, which sizes its own reads:
read_header_block:[0u8; 4096](src/http_proxy.rs:36)copy_exactbody copies:[0u8; 8192](src/http_proxy.rs:351)- tunnel / read-to-close responses: unsized
tokio::io::copy - carry buffers:
Vec::with_capacity(2048)
So clientReadBufferSize: 1024 is honored on a PROXY-protocol route and silently ignored on an xForwardedFor route on the same proxy.
Impact today is bounded: the new default (8192) equals what the body copies already use, so only a raised or lowered value is a no-op, and the primary high-connection-count target (MQTT on 8883) uses PROXY protocol and takes the plain path. #36 narrowed the README and doc comments to say so rather than leaving the proxy-wide claim standing, which is why this is a follow-up rather than a blocker there.
What to do
Thread the directional sizes through the rewrite pumps, keeping two concerns separate — they are currently conflated by using one constant for both:
- Parser bounds (how much header may be buffered before erroring) are a safety limit and should stay pinned to
MAX_HEADER_SIZE/MAX_CHUNK_LINE, not follow a user-tunable copy size. A 512-bytereadBufferSizemust not shrink the allowed header block. - Copy sizing (body copies, tunnels, read-to-close) is the memory-vs-syscall trade the config is actually for, and should follow the configured per-direction size.
Note the per-connection memory shape differs on this path: the rewriting pump holds a carry Vec plus its read buffers per direction, so the (client + upstream) × connections formula from #36 will need restating for these routes once they are tunable.
Alternative
If threading them through proves to muddy the framing logic, the other honest resolution is to leave these routes fixed and keep the documentation scoped as it is now — in which case close this issue with that rationale recorded. Worth deciding rather than leaving the asymmetry undocumented in the code.
Interacts with #37 (pooling the copy buffers), which will rework the plain path's buffer lifecycle and may make a shared abstraction available to both paths.
- 主要言語
- Rust
- スター
- 1
- フォーク
- 0
- 平均マージ
- 19時間 12分
- マージ済み PR(30日)
- 13
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
HarperFast/symphony のほかの issue
-
Don't route to a restarted upstream until it serves, not just accepts対応中かも @kriszyp が 5 日前に担当しました。 オープン
HarperFast/symphony#84 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Forward to a peer when the local upstream connect fails on a TLS-terminating failover route対応中かも @kriszyp が 5 日前に担当しました。 オープン
HarperFast/symphony#83 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
HarperFast/symphony#80 ·
メンテナーはふだん 1 日以内に返信
-
Forward a connection to a peer when its local upstream connect fails対応中かも @kriszyp が 5 日前に担当しました。 オープン
HarperFast/symphony#79 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
HarperFast/symphony#77 ·
メンテナーはふだん 1 日以内に返信
HarperFast/symphony の issue をすべて見る
似ている issue
-
area: cli kind:docs priority: P3
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
swc-project/swc-ai-issues#164 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
pop-os/cosmic-player#367 ·
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
servo/rust-smallvec#873 ·