summaryrefslogtreecommitdiff
path: root/crates/tor-chanmgr/src
Commit message (Collapse)AuthorAgeFilesLines
* tor-chanmgr: remove immediately awaited async block expressionSteven Engler2024-11-271-23/+15
| | | | This shouldn't be needed anymore now that we use a `Defer`.
* tor-chanmgr: use `Defer` in `AbstractChanMgr` to handle cancellationsSteven Engler2024-11-271-18/+23
|
* tor-chanmgr: add `util::defer` moduleSteven Engler2024-11-273-0/+79
| | | | | This contains the `Defer` type, which can be used to defer a closure until the `Defer` is dropped.
* tor-chanmgr: change `RequestCancelled` retry from `Never` to `Immediate`Steven Engler2024-11-211-1/+1
| | | | | | | If the channel request was cancelled, we should be able to retry immediately. Additionally, the `kind()` of `RequestCancelled` is `TransientFailure`, and I don't think it make sense for a transient error to return a `retry_time()` of `Never`.
* tor-chanmgr: fix reconfigure bug when given `CheckAllOrNothing`Steven Engler2024-11-121-2/+9
| | | | We shouldn't actually reconfigure anything if given `CheckAllOrNothing`.
* tor-chanmgr: remove panics in debug buildsSteven Engler2024-11-112-7/+1
| | | | | | These were supposed to fail loudly in debug builds by panicking, but panics are mostly useless for debugging in async applications that use a runtime which catches panics. So we'll just log the error instead.
* tor-chanmgr: rename `replace_pending_channel` to ↵Steven Engler2024-10-242-9/+10
| | | | `upgrade_pending_channel_to_open`
* tor-chanmgr: `remove_pending` now takes a `PendingChannelHandle`Steven Engler2024-10-241-18/+8
|
* tor-chanmgr: improve cleanup procedure of pending channelsSteven Engler2024-10-242-47/+92
| | | | | | | | | | An attempt to make sure that there are no code paths which forget to remove a pending channel from the channel map. This also adds error-level log messages and panics during debug builds if a `PendingChannelHandle` is dropped without properly passing it to `MgrState::remove_pending_channel` or `MgrState::replace_pending_channel`.
* Revert "tor-chanmgr: `PendingChannelHandle` removes the channel when dropped"Steven Engler2024-10-212-56/+34
| | | | | | | | This reverts commit f85bc3cf849109aaa2c4da9fc8c06e7173a0543f. There were some small conflcits in `AbstractChanMgr::get_or_launch_internal`, so this wasn't a clean revert.
* Merge branch 'chanmgr-select-docs' into 'main'David Goulet2024-10-171-0/+25
|\ | | | | | | | | tor-chanmgr: update comments about selecting pending channels See merge request tpo/core/arti!2544
| * tor-chanmgr: update comments about selecting pending channelsSteven Engler2024-10-161-0/+25
| |
* | tor-chanmgr: remove `handle_build_outcome`Steven Engler2024-10-151-28/+19
| |
* | tor-chanmgr: `PendingChannelHandle` removes the channel when droppedSteven Engler2024-10-152-27/+56
| |
* | tor-chanmgr: added `PendingChannelHandle`Steven Engler2024-10-152-36/+64
| | | | | | | | | | This handle contains all of the details required to remove or replace a pending channel entry from the channel map.
* | tor-chanmgr: refactor so we don't need `with_channels{,_and_params}`Steven Engler2024-10-152-78/+76
| | | | | | | | | | | | These methods on `MgrState` acquire a lock, and it's easy for calling code to also try to acquire the same lock within the closure, causing a deadlock. It's better to not expose these methods.
* | tor-chanmgr: fix some incorrect commentsSteven Engler2024-10-152-5/+3
| |
* | tor-chanmgr: removed use of `with_channels` within `request_channel`Steven Engler2024-10-151-61/+66
| | | | | | | | Best reviewed with the '-w' flag to hide whitespace changes.
* | tor-chanmgr: refactored `AbstractChanMgr::choose_action`Steven Engler2024-10-152-109/+145
|/ | | | | | | | This moves most of the channel map logic from `AbstractChanMgr::choose_action` to `MgrState::request_channel`. This is working towards being able to remove `MgrState::with_channels{,_and_params}`.
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-152-1/+3
| | | | Fixes a TODO.
* tor-chanmgr: fix `unused_imports` warning on `ChannelAccount`Steven Engler2024-10-091-1/+3
|
* tor-chanmgr: note API causes deadlocks under some conditionsSteven Engler2024-10-092-3/+16
|
* tor-chanmgr: minor code cleanupSteven Engler2024-10-091-5/+5
|
* tor-chanmgr: remove unused code pathSteven Engler2024-10-091-11/+3
|
* tor-proto: Make circuit->channel queues participate in memquotaIan Jackson2024-10-031-1/+12
| | | | | | | | We use the *channel*'s memquota account. This is arguably wrong, but it's hard to get right now. See #1652. Change the type of the queue, and the places it's constructed. The use sites can all stay the same.
* tor-proto: Plumb the ChannelAccount through to queue creation siteIan Jackson2024-10-034-10/+20
| | | | | This gets it as far as the outbound circuit->channel mpsc queue creation. Also, we provide an accessor for it.
* tor-proto: Plumb the ChannelAccount through to queue creation site (pre-fmt)Ian Jackson2024-10-031-1/+3
|
* tor-chanmgr: Make a memquota::ChannelAcocunt per channelIan Jackson2024-10-035-6/+20
| | | | | This delivers a fresh account per channel to the places where channels are actually made, but doesn't pass them to tor-proto yet.
* tor-chanmgr: Make a memquota::ChannelAcocunt per channel (pre-fmt)Ian Jackson2024-10-031-1/+4
|
* memquota: Add a toplevel account in tor-chanmgrIan Jackson2024-10-033-1/+17
| | | | | | | | | Plumb through a top-level account. This doesn't have any channel-specific, circuit-specific or stream-specific accounts yet. tor-circmgr's and tor-hsclient's *tests* need fake account. In arti-relay, use a dummy account for now.
* memquota: Add a toplevel account in tor-chanmgr (pre-fmt)Ian Jackson2024-10-031-1/+2
|
* 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.