Skip to content

usockets: wait for the TLS spill at the HTTP close gates; drain a large https response after peer FIN - #35109

Merged
Jarred-Sumner merged 5 commits into
mainfrom
farm/182abfd3/https-half-close-spill
Jul 22, 2026
Merged

usockets: wait for the TLS spill at the HTTP close gates; drain a large https response after peer FIN#35109
Jarred-Sumner merged 5 commits into
mainfrom
farm/182abfd3/https-half-close-spill

uWS: gate the HTTP close-after-drain on hasFullyDrained() instead of …

fe40534
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 22, 2026 in 12m 41s

Code review found 1 potential issue

Found 5 candidates, confirmed 1. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit packages/bun-uws/src/HttpContext.h:212-214 Stale comments: getBufferedAmount() does not count the TLS spill; hasFullyDrained() does

Annotations

Check warning on line 214 in packages/bun-uws/src/HttpContext.h

See this annotation in the file changed.

@claude claude / Claude Code Review

Stale comments: getBufferedAmount() does not count the TLS spill; hasFullyDrained() does

Two comments still describe the earlier approach where `getBufferedAmount()` itself counted the TLS spill: the `onOpen<IsNodeHttp>` comment at `packages/bun-uws/src/HttpContext.h:212` ("getBufferedAmount() counts the TLS spill, so onEnd's defer and onWritable's close gate are accurate for both transports") and the doc comment above `us_internal_ssl_spill_pending()` at `packages/bun-usockets/src/crypto/openssl.c:2117` ("uWS's getBufferedAmount() adds this …"). After commit fe40534e, `getBufferedA