aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/channel/codec.rs
Commit message (Collapse)AuthorAgeFilesLines
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-3/+3
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-proto: remove `use asynchronous_codec as futures_codec`Neel Chauhan2025-02-061-12/+12
| | | | Closes #1690.
* tor-rtcompat: Big invasive change adding StreamOps bound everywhere.Gabriela Moldovan2025-01-151-0/+3
| | | | | | This is unfortunately necessary, because after the channel handshake, we need to give the channel reactor a `StreamOps` handle to the underlying stream.
* Change `CircId` to never be zeroJim Newsome2023-10-251-4/+4
| | | | | | | | | | This changes the internal representation to be `NonZeroU32` instead of just `u32`. Various places where a circuit ID is optional now use `Option<CircId>`. Fixes a bug in `CircIdRange::sample` that would previously return a circuit ID of 0, when the rng returned 0x8000_0000 for a low range.
* Upgrade to latest asynchronous_codec (0.7.0)Nick Mathewson2023-10-171-2/+2
|
* tor-proto: only parse allowed ChanMsg types during handshake.Nick Mathewson2023-02-091-14/+71
|
* tor-cell: Rename ChanMsg and ChanCell-related types.Nick Mathewson2023-02-071-6/+6
|
* tor-cell: Remove ChanMsg methods that are duplicated in ChanMsgClass.Nick Mathewson2023-02-071-1/+1
|
* tor-proto: Split CellErr based on activity.Nick Mathewson2022-06-231-3/+6
| | | | | | Failing to encode is fundamentally different from failing to decode. We now treat those separately, and describe _what_ we failed to encode or decode.
* tor-proto: clean up error names and messagesNick Mathewson2022-06-231-3/+3
| | | | | This avoids adding additional information for now; that will come on the next commits.
* proto: Refactor conversion from CodecError to ErrorNick Mathewson2022-02-241-10/+0
| | | | | Remove default conversion; instead use a specific conversion in each of the two modules that need to do it.
* tor-proto: Split IoErr based on when it occursNick Mathewson2022-02-231-2/+2
| | | | | | | We want to distinguish handshake failures from errors later on in the channel's lifetime. Closes #359.
* tor-cell: provide HasKind.Nick Mathewson2022-02-151-4/+34
| | | | | | | | | Additionally, refactor the IoError out of tor_cell::Error: nothing in TorCell created this; it was only used by tor_proto. This required refactoring in tor_proto to use a new error type. Here I decided to use a new CodecError for now, though we may refactor that away soon too.
* tor-proto: Use tor-rtcompat macros for testing, not tokio.Nick Mathewson2021-11-151-37/+40
| | | | Closes #222.
* Get rid of tor-proto's ChannelImpl, and use the reactor more insteadeta2021-11-031-2/+3
| | | | | | | | | | | | | | | | | | | Instead of awkwardly sharing the internals of a `tor-proto` `Channel` between the reactor task and any other tasks, move most of the internals into the reactor and have other tasks communicate with the reactor via message-passing to allocate circuits and send cells. This makes a lot of things simple, and has convenient properties like not needing to wrap the `Channel` in an `Arc` (though some places in the code still do this for now). A lot of test code required tweaking in order to deal with the refactor; in fact, fixing the tests probably took longer than writing the mainline code (!). Importantly, we now use `tokio`'s `tokio::test` annotation instead of `async_test`, so that we can run things in the background (which is required to have reactors running for the circuit tests). This is an instance of #205, and also kind of #217.
* fix/silence clippy lints in test modulesDaniel Eades2021-09-081-0/+1
|
* Move all crates into a `crates` subdirectory.Nick Mathewson2021-08-271-0/+156
This will cause some pain for now, but now is really the best time to do this kind of thing.