aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-chanmgr: Provide a variant for memquota errorsIan Jackson2024-10-031-0/+8
|
* tor-chanmgr: minor doc improvementsSteven Engler2024-10-011-3/+3
|
* tor-chanmgr: add unit testsSteven Engler2024-10-011-0/+416
|
* tor-chanmgr: change `choose_best_channel` to take `IntoIterator`Steven Engler2024-10-011-1/+3
|
* tor-chanmgr: don't allow pending channels with no relay idsSteven Engler2024-10-011-1/+7
|
* tor-chanmgr: move channel selection logic to a new moduleSteven Engler2024-10-012-162/+172
|
* tor-chanmgr: improve readability of `choose_best_channel`Steven Engler2024-10-011-13/+45
|
* tor-socksproto: Handle 0-byte reads (EOF) correctlyIan Jackson2024-10-011-1/+1
| | | | | | | This restores the functionality of socks users: detect closed sockets. 0c595818f713916d94b7b0e4062f953fad7c9799 which we reverted as part of rebasing this branch onto main.
* tor-chanmgr: Use new tor-socksproto API (fmt)Ian Jackson2024-10-011-2/+1
|
* tor-chanmgr: Use new tor-socksproto APIIan Jackson2024-10-011-56/+16
|
* Apply deferred rustfmt churnIan Jackson2024-10-011-3/+2
|
* tor-socksproto: Move `handshake` to be a trait methodIan Jackson2024-10-011-0/+1
| | | | | | | | | | | This deduplicates some docs and eliminates the two wrapper functiosn for `run_handshake`, which is now just `handshake`. We're going to make other API breaks too, and this isn't going to be the primary API, so we might as well do this. Proper description of the semver breakage will come at the end when it's all done.
* Revert "socks users: detect closed sockets."Ian Jackson2024-10-011-11/+1
| | | | This reverts commit 0c595818f713916d94b7b0e4062f953fad7c9799.
* Revert "socks users: copy the correct amount in our drain logic."Ian Jackson2024-10-011-1/+1
| | | | This reverts commit dceeb82f7d1154894ab9c7c607d68f8335bb9615.
* Merge branch 'misc' into 'main'Ian Jackson2024-10-011-3/+6
|\ | | | | | | | | Miscellaneous cleanups, mostly in tor-memquota See merge request tpo/core/arti!2461
| * tor-proto: Reformat a doc commentIan Jackson2024-09-261-3/+6
| | | | | | | | | | | | Make it have a summary line of only reasonable size. While we're here, wrap the body with semantic linefeeds.
* | Merge branch 'orport' into 'main'opara2024-09-303-133/+298
|\ \ | | | | | | | | | | | | tor-chanmgr: support multiple channels for a relay ID See merge request tpo/core/arti!2442
| * | tor-chanmgr: support multiple channels for a relay IDSteven Engler2024-09-302-133/+292
| | |
| * | tor-linkspec: add `ListByRelayIds`Steven Engler2024-09-231-0/+6
| | | | | | | | | | | | Like `ByRelayIds`, but allows multiple items per relay ID.
* | | Merge branch 'upgrades-20240925' into 'main'Nick Mathewson2024-09-261-3/+3
|\ \ \ | |_|/ |/| | | | | | | | Upgrade dependencies in preparation for next week's releases. See merge request tpo/core/arti!2450
| * | Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-3/+3
| | | | | | | | | | | | | | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* | | socks users: copy the correct amount in our drain logic.Nick Mathewson2024-09-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When calling copy_within, we want to copy the amount of data that we're keeping; previously, we were copying an extra `action.drain` bytes, which could have led to a panic. Spotted by Opara.
* | | socks users: detect closed sockets.Nick Mathewson2024-09-241-1/+11
|/ / | | | | | | | | | | | | | | | | Without this check, our socks code can enter an infinite loop if a socket is closed at the wrong time. Resolves TROVE-2024-011. Fixes #1635.
* | rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-244-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* | rtcompat: Remove accept() from TcpListenerNick Mathewson2024-09-241-1/+7
|/ | | | | | | | | | It's redundant with the incoming() method (which turns the TcpListener into a Stream of connections), and nothing actually used it outside of tests. Removing this method allows us to simplify our TcpListener code a good deal, as can be seen by some of the implementations we removed from our example and testing code.
* tor-chanmgr: add experimental `ChanMgr::handle_incoming`Steven Engler2024-09-116-3/+151
| | | | | | | | | The channel manager in the future will need to be able to receive incoming streams. The type of the stream depends on an associated type within `ChannelFactory`, so this commit exposes this associated type through several other types, eventually to the `ChanMgr`. The new methods are behind the experimental "relay" feature flag.
* tor-chanmgr: make `CompoundFactory` generic over `ChannelFactory`Steven Engler2024-09-112-30/+21
| | | | | | | | | | This has two advantages: 1. Code is a little easier to follow with generics rather than dynamic dispatch, especially since the type is fixed at compile time anyways. 2. It allows us to access associated types of the `ChannelFactory`, which will be useful later for getting the stream type from the `ChanBuilder`.
* tor-netdir: Allow access to the `ConsensusBuilder` when building test netdirs.Gabriela Moldovan2024-09-091-2/+2
| | | | | This allows us to set SRVs for example (needed because by default, the test `NetDir` is built from a consensus that doesn't contain any SRVs).
* socksproto: Add a const for suggested buffer length.Nick Mathewson2024-09-091-1/+2
| | | | | Ticket #1509 will probably get rid of this constant, but for now we may as well put it in one place.
* extract tor_async_utils::oneshot into ::oneshot-fused-workaroundJim Newsome2024-08-281-1/+1
| | | | | | | | | | | | | | Having this in the `tor-async-utils` crate prevents us from doing both of the following without introducing a circular dependency: * using it in `tor-rtmock` (which we currently do, particularly in tests). * using `tor-rtmock` to test things in `tor-async-utils`. We don't do this yet, but it is generally sensible to do so. In particular we want to move the `stream_peak` module there, which is currently tested with `tor-rtmock`. Moving this into its own crate avoids this circular dependency.
* Merge branch 'chan_arc' into 'main'Nick Mathewson2024-05-286-32/+34
|\ | | | | | | | | Proto: Refactor Channel to always be Arc. See merge request tpo/core/arti!2163
| * Make Channel non-Clone.Nick Mathewson2024-05-161-2/+2
| |
| * proto: Make Channel explicitly Arc<.>Nick Mathewson2024-05-166-30/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, Channel was a type that you could Clone that implicitly its state. Now, Channel always appears as an Arc<Channel>. This change has several benefits: * It makes the relationship between Channel struct and the underlying channel more clear. * It enables Channel to participate in the RPC system, where everything has to be an Arc<.> * It enables us to have a Weak<Channel>, if we ever want to. * It will let us move various members out of ChannelDetails. We did this change a while ago with ClientCirc.
* | chanmgr: Delegate to Channel::engage_padding_activities explicitly.Nick Mathewson2024-05-171-1/+1
|/ | | | | | (This isn't a bugfix, but it helps avoid the appearance of a function calling itself. This _would_ become a bug if we imported the wrong trait into scope here.)
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-138-0/+8
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* educe: Use std's default for enums where default variant is unitIan Jackson2024-02-121-4/+2
| | | | | | | | | | | | | Since Rust 1.66, std's default works properly for enums, provided that the default variant is a unit. Review all uses of `#[educe(default)]` on enums and replace them with std where possible, which is most of them. In 1.66 and later, std's `#[derive(Default)]` doesn't infer any generic bounds on the derived impl, where it's an enum - since the unit variant can always be constructed. So this change doesn't add any generic bounds and is not API-visible.
* ChannelState::ready_to_expire: return true when rem time is zeroJim Newsome2023-12-131-0/+5
| | | | | | | | | | | This fixes a race condition that would normally be fairly benign - it would result in scheduling to check for expired channels again immediately, and assuming non-zero time passes would then remove the channel. In Shadow's default time model though, zero time passes in this case, so we just keep scheduling to check again immediately forever; i.e. deadlock.
* ChannelState::ready_to_expire: refactor using let-elseJim Newsome2023-12-131-18/+14
|
* continually_expire_channels: don't round off expiration delayJim Newsome2023-12-131-1/+1
| | | | | | | | | Without this change, if the delay is less than one second, the code will effectively busy-loop until the delay has elapsed. This potentially leads to deadlock in shadow simulations, and wastes CPU in real usage. https://shadow.github.io/docs/guide/limitations.html?highlight=busy#busy-loops
* continually_expire_channels: refactor using let-elseJim Newsome2023-12-131-3/+2
|
* oneshot: Apply deferred rustfmt churnIan Jackson2023-10-111-1/+1
| | | | cargo fmt, precisely.
* oneshot: Use veneer in tor-chanmgrIan Jackson2023-10-111-1/+1
|
* Add initial support for running a PT in server modeSaksham Mittal2023-08-242-3/+3
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-238-0/+8
|
* Resolve a pair of warnings about redundant closures.Nick Mathewson2023-08-221-1/+1
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|
* Fix a pair of rustdoc links in chanmgr.Nick Mathewson2023-07-191-2/+2
|
* Move an import to resolve a warning.Nick Mathewson2023-07-131-1/+2
|