You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit a778ca1
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cancel): a token belongs to its call; downloads take one; openkal Windows has entropy
The token is set on the socket at the bottom of a connection and nowhere else.
TlsSocket::set_stop forwards to the session beneath it, which is where every
wait happens inside an https:// proxy's tunnel; setting only its own socket left
a reused tunnel on the token of the call that opened it. Once that token was
stopped, which a std::jthread does in its destructor, every wait on the tunnel
failed at once and the stale-connection retry sent a POST that had already
arrived a second time; a later call's own token never reached the tunnel at all.
PooledConnection::keep() takes the token off the connection it returns to the
pool, so nothing in the pool carries one.
download_to_file takes a std::stop_token as its last argument, and
DownloadToFileResult::cancelled is set by it or by isCancelled, as
HttpResponse::cancelled is. proxy_connect, the wrapper nothing here calls, does
not take one.
Where the C library is musl, the TLS random generator is seeded from musl's
getentropy rather than mbedTLS's reading of /dev/urandom, which above openkal on
x86_64-windows-musl does not exist: every handshake there failed with
"CTR_DRBG - The entropy source failed".
Tests: a stop after the call returned does not reach the next call, and the
next call's token does, each directly, through an http:// proxy and through an
https:// proxy; a SOCKS5 proxy that never answers; a download cancelled before
the head, during the body, with a token already stopped, and by isCancelled.
test_cancel imports std before its includes under libc++, whose 20 and 22 fail
to link stop_source::request_stop() the other way round.
examples/openkal follows mcpp-index's openkal pins (runtime 0.15.2) and cancels
a handshake against a local listener, which needs no network; it runs on
x86_64-linux-gnu, x86_64-linux-musl, aarch64-linux-musl and x86_64-windows-musl.
0 commit comments