mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-06-10 16:47:14 +00:00
The auto-added `Expect: 100-continue` (for bodies >= 1024 bytes) decided whether to withhold the request body based on raw socket readability via select_read(). Over TLS, post-handshake records such as TLS 1.3 session tickets make the socket readable without any HTTP response being available, so the client withheld the body and then blocked reading a response that never came, failing with `Failed to read connection`. Decide based on whether a status line can actually be read within the 100-continue timeout instead: temporarily shorten the read timeout, try to read the status line, and if none arrives, send the body and proceed as usual (matching curl). This keeps the `100 Continue` and early final-response paths working while no longer being fooled by TLS records. Add a regression test using a raw OpenSSL server that never sends `100 Continue`.