Copy-buffer settings do not reach the HTTP/1 header-rewriting path
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- rust
- Área
- backend, networking
Línea de trabajo
Empieza en src/http_proxy.rs, en read_header_block, copy_exact, las copias de tunnel/read-to-close y las asignaciones del carry-buffer. Sigue cómo la configuración direccional de #36 llega a los rewrite pumps, manteniendo separados los límites del parser del dimensionamiento de las copias; revisa también #37 antes de elegir un enfoque. Se considera terminado cuando las rutas de rewrite respetan los tamaños de copia configurados, los límites del parser permanecen fijos y se actualiza la documentación o justificación de la memoria por conexión.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 1
- Forks
- 0
- Merge medio
- 19 h 12 min
- PR fusionados (30 d)
- 13
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de HarperFast/symphony
-
Don't route to a restarted upstream until it serves, not just acceptsPosiblemente ocupada @kriszyp la tomó hace 5 días. Abierto
HarperFast/symphony#84 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Forward to a peer when the local upstream connect fails on a TLS-terminating failover routePosiblemente ocupada @kriszyp la tomó hace 5 días. Abierto
HarperFast/symphony#83 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
HarperFast/symphony#80 ·
Los mantenedores suelen responder en 1 día
-
Forward a connection to a peer when its local upstream connect failsPosiblemente ocupada @kriszyp la tomó hace 5 días. Abierto
HarperFast/symphony#79 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
HarperFast/symphony#77 ·
Los mantenedores suelen responder en 1 día
Todos los issues de HarperFast/symphony
Issues similares
-
area: cli kind:docs priority: P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
swc-project/swc-ai-issues#164 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
pop-os/cosmic-player#367 ·
-
good first issue help wanted
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
servo/rust-smallvec#873 ·