Repository navigation
What's Changed
Behavior changes
- Client: a kept-alive connection is no longer reused while bytes that belong to no request are waiting on it. The connection is closed and the next request opens a new one. Those bytes used to be read as the next request's response. As in curl, the reuse check no longer asks the TLS library whether the peer closed, so a TLS message arriving on an idle connection, such as a late session ticket, now costs a new connection.
- Client: a
Content-Lengthpassed with a request is dropped when the library compresses the body underset_compress(true)or sends it chunked (#2679). The library then sends a length that matches the body it writes, or none for a chunked body.
Security-relevant fixes
- Server (Windows): a junction or symbolic link inside a mount point no longer serves a file outside the mount (#2670).
canonicalize_pathonly normalized the path text and did not follow reparse points, so the check that keeps a request inside the mount point passed whatever the link pointed to. - Client:
- Do not read stray bytes on a kept-alive connection as a response, as described above.
- Do not send a stale
Content-Lengthwith a reframed body, as described above (#2679). The value described the original body, so with compression the server read only part of the gzip stream and took the rest as the start of the next request on the connection. With a chunked body the request carried bothContent-LengthandTransfer-Encoding. - A stream opened while a request on another thread is waiting for its response no longer takes over that request's connection (#2669). Both used to share one connection, and each could receive the other's response.
Bug fixes
- Client:
stop()ends a request or a stream that is still opening its connection: the connect, the TLS handshake, or theCONNECTof a proxy tunnel (#2668). It used to wait until the connection opened or timed out (300 seconds by default). The call now returnsError::Canceled.- A timeout too large for the clock waits without end instead of expiring at once (#2668).
- Close the connection when the TLS handshake inside a proxy's
CONNECTtunnel fails. It used to stay open with no TLS session on it until the next request.
- Server:
stop()ends a WebSocket handler waiting inread()(#2682). The read returnsFailafter sending a Close with 1001 Going Away, so awhile (ws.read(msg) != Fail)loop ends andlisten()returns. The handler used to wait up to 300 seconds, or loop forever onTimeoutwhen a read timeout was set.SSLServerdrains the socket before closing a connection, asServerhas done since #2534 (#2673, #2672). Closing with unread data could be answered with a RST, which can make the peer discard a response it has received but not yet read, as Windows does.
- WebSocket:
close()bounds its wait for the peer's Close reply as a whole (#2678). The read timeout applied to each read, so a peer that kept sending other frames could holdclose()for as long as it liked.- A
read()assembling a fragmented message ends withFailonceclose()is called (#2683). A peer that kept sending fragments used to keep it from ending.
Headers::erase()removes every matching field when the key refers to an entry of the sameHeaders, as inheaders.erase(headers.begin()->first)(#2659). The key could change as entries moved, so matching fields were left behind and another field was removed.
Full Changelog: v0.66.0...v0.67.0