Skip to content

v0.67.0

Latest

Choose a tag to compare

@yhirose yhirose released this 18 Nov 17:28
· 1 commit to master since this release

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-Length passed with a request is dropped when the library compresses the body under set_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_path only 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-Length with 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 both Content-Length and Transfer-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 the CONNECT of a proxy tunnel (#2668). It used to wait until the connection opened or timed out (300 seconds by default). The call now returns Error::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 CONNECT tunnel fails. It used to stay open with no TLS session on it until the next request.
  • Server:
    • stop() ends a WebSocket handler waiting in read() (#2682). The read returns Fail after sending a Close with 1001 Going Away, so a while (ws.read(msg) != Fail) loop ends and listen() returns. The handler used to wait up to 300 seconds, or loop forever on Timeout when a read timeout was set.
    • SSLServer drains the socket before closing a connection, as Server has 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 hold close() for as long as it liked.
    • A read() assembling a fragmented message ends with Fail once close() 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 same Headers, as in headers.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