mirror of
https://github.com/yhirose/cpp-httplib.git
synced 2026-10-28 21:14:04 +00:00
The event loop reads through open_stream(), which takes the socket out of the Client, so the client_.stop() in stop() could not reach it. stop(), and the destructor with it, waited until the server sent something or the read timeout passed, 300 seconds by default. The loop now hands the stream's socket to stop() while it reads, and withdraws it under the same lock before the socket is closed. stop() shuts down the read side only: a TLS backend answers the EOF with an alert, and writing it to a socket closed for writing raises SIGPIPE.