This adds support for the SSLKEYLOGFILE environment variable which is
a common standard used by browsers to log the TLS keys used for
connections. It allows traffic inspectors like tcpdump and wireshark
to use the logged keys and decrypt the traffic. Using this is a first
step to allowing us to observe our protocol on the wire.
The support is still hidden behind a commandline option so that it can
not be accidentally enabled by only having an environment variable
set.
This refactor splits the `handle_stream` function up into smaller
(logical) functions. If these functions error, we can emit a
`TransferAborted` event before returning the error.
This has the added benefit of making the `handle_stream` function a bit
easier to take in. None of these new functions have any code changes,
the only difference is how errors are handled and when we return.
When finished with a stream you have to read to EOF. Sometimes the
sender could be sending the FIN bit in an empty STREAM frame after all
the data is sent, if the receiver did not read EOF in this case the
receiver will still implicitly call `RecvStream::stop` on drop, making
the stream error for the sender.
Co-authored-by: Floris Bruynooghe <flub@devork.be>
Sending a STOP_STREAM frame from the receiver is the way for a receiver
to go to the reset state. It involves sending an extra frame, the
receiver will then send its own RESET_STREAM frame and the stream is
considered ended in an error state.
Instead the right way to end a stream is to set the FIN bit on the final
STREAM frame, ideally not even resulting in an extra frame or packet
sent. This is done on the sender side.
This adds a generic utility which can be used to track progress of
data transfers by emitting progress via a tokio broadcast channel.
This is extracted from the deltachat PR:
https://github.com/deltachat/deltachat-core-rust/pull/4007
This makes it so that the provider is allowed to close the connection
after a transfer is completed, without the getter resulting in an
error.
It modifies the provider to only emit the transfer completed once the
data has actually reached the client.
The tokio feature of tracing-futures seems crazy outdated and not
needed. Enabling it pulls in an ancient version of tokio for no
reason whatsoever. Get rid of it.
This adds Provider::shutdown allowing to stop the Provider without
having to abort it. On the wire however it still does not do anything
graceful: all the connections are stopped and any in-transit data is
lost.
Additionally this adds tracing spans to the connection handling.
Finally it fixes a bug where read_lp would not return None if the
connection was closed normally.
Part of #77 but this is not very graceful on the wire yet.
This removes the consuming Provider::join method and makes Provider impl
a
Future directly. This mirrors how a JoinHandle for a tokio task
behaves, which is what this also kind off is.
Primarily this allowes for the await-completion operation to be
cancelable and re-entrant. This is needed to be able to await
completion of the task in a loop, repeatedly calling tokio::select!
with it.
- avoids relying on blake3::Hash as a type in the public api
- ensures consistent encoding and decoding
- fixes bug where hex decoding was expected in the UI
The public interface is now BaoDecoder. A benefit of this is that we
- hide the exact way we decode bao (bao crate or our own thing)
- hide the s2n_quic::stream::ReceiveStream