summaryrefslogtreecommitdiff
path: root/crates/tor-proto
Commit message (Collapse)AuthorAgeFilesLines
...
* | Merge branch 'debug-datastream' into 'main'eta2022-02-241-4/+11
|\ \ | | | | | | | | | | | | tor-proto datastream: Do not dump packet data in DataWriterImpl See merge request tpo/core/arti!353
| * | Fix rustfmtIan Jackson2022-02-241-1/+1
| | |
| * | tor-proto datastream: Do not dump packet data in DataWriterImplIan Jackson2022-02-241-2/+9
| | |
| * | tor-proto datastream: import std::fmt::Debug trait nameIan Jackson2022-02-241-2/+2
| | |
* | | Merge branch 'proto_handshake_err' into 'main'Nick Mathewson2022-02-249-95/+140
|\ \ \ | |/ / |/| | | | | | | | | | | | | | tor-proto: Split up a couple of handshake-based errors Closes #359 and #358 See merge request tpo/core/arti!344
| * | proto: Refactor conversion from CodecError to ErrorNick Mathewson2022-02-243-32/+37
| | | | | | | | | | | | | | | Remove default conversion; instead use a specific conversion in each of the two modules that need to do it.
| * | tor-proto: refactor handshake protocol errors to a different typeNick Mathewson2022-02-232-52/+79
| | | | | | | | | | | | | | | | | | | | | | | | This helps the user distinguish between protocol violations that happen when connecting to the tor network from those that happen while connected. Closes #358.
| * | tor-proto: Rename BadHandshake to BadCircHandshakeNick Mathewson2022-02-237-12/+12
| | | | | | | | | | | | (We'll have a BadChanHandshake soon.)
| * | tor-proto: Split IoErr based on when it occursNick Mathewson2022-02-233-18/+31
| |/ | | | | | | | | | | | | We want to distinguish handshake failures from errors later on in the channel's lifetime. Closes #359.
* | Merge branch 'remote_stream_err' into 'main'eta2022-02-241-3/+1
|\ \ | | | | | | | | | | | | | | | | | | Give specific error kinds to different END reasons Closes #360 See merge request tpo/core/arti!343
| * | Give specific error kinds to different END reasonsNick Mathewson2022-02-231-3/+1
| |/ | | | | | | Closes #360.
* | Merge branch 'debug-datastream' into 'main'eta2022-02-243-2/+19
|\ \ | |/ |/| | | | | impl Debug for DataStream (and its components) See merge request tpo/core/arti!351
| * impl Debug for DataStream (and its components)Ian Jackson2022-02-243-2/+19
| | | | | | | | | | | | | | | | | | My proximate motivation is that tls-api wants its inner streams to be Debug. But in general, I agree with the Rust API Guidelines notion that almost everything should be Debug. I have gone for the "dump all the things" approach. A more nuanced approach would be possible too.
* | Merge remote-tracking branch 'origin/mr/340'Nick Mathewson2022-02-235-29/+52
|\ \
| * | Eliminate RequestedResourceAbsent kind.Nick Mathewson2022-02-225-23/+46
| | | | | | | | | | | | | | | | | | | | | | | | There was only one use of this, and it was in as-yet-unused relay-only code. Removing this type required refactoring the relay onion handshake code to use its own error type, which is probably clever anyway.
| * | Fold NamespaceFull into BadApiUsage.Nick Mathewson2022-02-221-1/+1
| | |
| * | Rename RemoteNameError to RemoteHostNotFoundNick Mathewson2022-02-221-2/+2
| | | | | | | | | | | | | | | This is a bit ugly but we need it to work around the problem where exits aren't always clear about _why_ a hostname lookup failed.
| * | Replace RemoteRefused with CircuitRefused.Nick Mathewson2022-02-221-1/+1
| | | | | | | | | | | | Also document that it's a lower-level error kind.
| * | Rename RemoteIdMismatch to RelayIdMismatch.Nick Mathewson2022-02-221-1/+1
| | |
| * | Fold AlreadyClosed into BadApiUsageNick Mathewson2022-02-221-1/+1
| |/
* / Remove clippy::needless_borrow exception in CI.Nick Mathewson2022-02-201-1/+0
|/ | | | | This exception is no longer necessary now that the underlying CI bug is fixed.
* Replace as_mut with deref impl for MutCircEntYuan Lyu2022-02-162-26/+34
|
* Make CircMap open_ent_count O(1)Yuan Lyu2022-02-162-26/+76
|
* tor_proto::Error: Fix an incomplete sentence.Nick Mathewson2022-02-161-1/+2
|
* Update tor-proto errors to latest API.Nick Mathewson2022-02-1511-43/+41
|
* Make tor-proto::Error implement HasKind.Nick Mathewson2022-02-153-26/+54
| | | | | | This took some refactoring, and gave an opportunity to notice a few error variants that weren't being used, or didn't mean what they said on the tin.
* tor-proto: use InternalError for internal errors.Nick Mathewson2022-02-1513-45/+84
|
* tor-cell: provide HasKind.Nick Mathewson2022-02-154-17/+49
| | | | | | | | | 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.
* Merge branch 'warn_not_deny' into 'main'eta2022-02-141-1/+1
|\ | | | | | | | | | | | | Change deny(clippy::all) to warn(clippy::all). Closes #338 See merge request tpo/core/arti!306
| * Change deny(clippy::all) to warn(clippy::all).Nick Mathewson2022-02-141-1/+1
| | | | | | | | Closes #338.
* | Use atomic set-and-check to update OptTimestamps if none.Nick Mathewson2022-02-092-4/+38
|/ | | | | | | This fixes a tiny race condition in the previous code, where we checked whether an OptTimestamp is None a bit before we set it. Since std::atomic gives us compare_exchange, we might as well use it.
* Remove the use of Mutex in channel unused_since timestampYuan Lyu2022-02-084-58/+67
|
* Expire channels that have been unused for too longYuan Lyu2022-02-043-14/+97
|
* Merge branch 'eta/reactor-2.5' into 'main'eta2022-02-031-33/+60
|\ | | | | | | | | Fix severe reactor ordering problems See merge request tpo/core/arti!282
| * Fix severe reactor ordering problemseta2022-02-031-33/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of severe problems with the circuit reactor were fixed which could cause reordering of cells (which causes relays to terminate the circuit with a protocol violation, as they become unable to decrypt them). These mostly revolve around improper usage of queues: - The code assumed that a failure to place cells onto the channel would persist for the duration of a reactor cycle run. However, under high contention, this wouldn't always be the case. - This leads to some cells getting enqueued while others go straight through, before the enqueued cells. - To fix this, we block sending cells out of the channel while there are still some enqueued. - The hop-specific queues queued after encryption, not before. This was very brittle, and led to frequent mis-ordering. - This was fixed by making them not do that. This is arti!264 / 5bce9db5628126be2b736f228211174fe4132918 without the refactor part.
* | Merge branch 'dirclient-testing' into 'main'Nick Mathewson2022-02-031-1/+1
|\ \ | | | | | | | | | | | | dir-client: bug fix and more tests See merge request tpo/core/arti!271
| * | Upgrade required version of futures crate to 0.3.14Nick Mathewson2022-02-011-1/+1
| |/ | | | | | | | | Earlier versions have a bug in UnboundedReceiver that make our new dirclient tests fail.
* | Merge branch 'typos' into 'main'eta2022-02-032-2/+2
|\ \ | | | | | | | | | | | | Fix typos See merge request tpo/core/arti!285
| * | Fix typosDimitris Apostolou2022-02-022-2/+2
| |/
* | Temporarily disable some clippy lints on nightlyIan Jackson2022-02-021-0/+1
| |
* | Remove many needless borrows and slicesIan Jackson2022-02-023-6/+6
|/ | | | | | | Found via clippy::needless_borrow. In some cases I removed needless `[..]` too. See also: needless_borrow suggestion doesn't go far enough https://github.com/rust-lang/rust-clippy/issues/8389
* Bump the patch version of every crate that changed since 0.0.3Nick Mathewson2022-01-311-2/+2
|
* Use script to update README.md files.Nick Mathewson2022-01-281-3/+0
|
* Make the native-tls crate optional.Nick Mathewson2022-01-261-3/+1
| | | | | | | | | | | This commit puts the native-tls crate behind a feature. The feature is off-by-default in the tor-rtcompat crate, but can be enabled either from arti or arti-client. There is an included script that I used to test that tor-rtcompat could build and run its tests with all subsets of its features. Closes #300
* Remove a now-incorrect comment in tor-proto.Nick Mathewson2022-01-261-3/+0
|
* clippy: Rename a `decode_chanmsg` from `handle_`Ian Jackson2022-01-192-4/+4
| | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/249#note_2771025 It doens't really handle it.
* handshake: Use read_exact, not read and checking lenIan Jackson2022-01-191-3/+7
| | | | | | | | | read_exact has a loop in it, which we need. This means we end up separating the two sites that generate the "not a relay" error, so we need to fish out the error construction. As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/249#note_2771023
* clippy: Rename a `from_foo` method that doesn't do conversionIan Jackson2022-01-193-5/+7
|
* Fix two bugs related to incomplete read/writeIan Jackson2022-01-191-3/+3
| | | | Discovered by clippy
* Merge branch 'channel-arc-rework-5' into 'main'eta2022-01-132-52/+73
|\ | | | | | | | | chanmgr: get rid of Arc around Channel See merge request tpo/core/arti!236