mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-12-05 08:05:12 +00:00
Upstream added WithBodyReadTimeout (gateway.request_body_read_timeout_seconds) and client-gone handling for body reads. Drop this branch's own server-level idle-timeout wrapper and server.request_body_idle_timeout setting in favor of it, and keep the classification and diagnostics on top: - readRequestBodyChunksWithBudget reports the read error before ctx.Err(): on HTTP/1 a read deadline also cancels the request context, which turned every timeout into context.Canceled. Read errors carry bytes read and elapsed time in RequestBodyReadError. - handleRequestBodyReadError and RejectRequestBodyReadError skip the client-gone (empty 499) path for read timeouts, so they are reported as 408 instead of a client cancellation (HTTP/1) or a generic 400 (HTTP/2). - Every gateway body read site and both body-reading middlewares log payload-free diagnostics, including the client-gone path.