summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/tunnel
Commit message (Collapse)AuthorAgeFilesLines
* tor-proto: remove unnecessary `Option` from `circuit_action`Steven Engler2025-03-262-10/+9
|
* tor-proto: fix possible bug when there are no ready streamsSteven Engler2025-03-261-13/+21
|
* Merge branch 'circuit-action' into 'main'opara2025-03-252-16/+17
|\ | | | | | | | | tor-proto: simplify `ConfluxSet::circuit_action` See merge request tpo/core/arti!2884
| * tor-basic-utils: move `flatten` from tor-protoSteven Engler2025-03-251-10/+1
| | | | | | | | I also added an additional non-doc TODO comment.
| * tor-proto: simplify tunnel `run_once`Steven Engler2025-03-241-7/+1
| | | | | | | | As far as I can tell, the extra drop handling code isn't needed anymore.
| * tor-proto: remove `CircuitActionResult` aliasSteven Engler2025-03-241-4/+1
| | | | | | | | | | I think the return type is simplified enough now that we don't need this.
| * tor-proto: change `ConfluxSet::next_circ_action` to return a `Future`Steven Engler2025-03-242-6/+25
| | | | | | | | | | | | Now returns only the first item of the stream rather than the stream itself. We use this in `Reactor::run_once`, which means we only ever use the first item anyways.
| * tor-proto: rename `ConfluxSet::circuit_action` to `next_circ_action`Steven Engler2025-03-242-6/+6
| |
* | Merge branch 'circuit-cmd' into 'main'gabi-2502025-03-253-66/+155
|\ \ | |/ |/| | | | | tor-proto: Replace RunOnceCmdInner with CircuitCmd in Circuit impl See merge request tpo/core/arti!2881
| * tor-proto: Add a TODO about supporting incoming streams with conflux.Gabriela Moldovan2025-03-241-0/+1
| |
| * tor-proto: Clarify the semantics of various CircuitCmds.Gabriela Moldovan2025-03-241-3/+3
| | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2881#note_3178624
| * tor-proto: Add a TODO about the unnecessary Vec allocations.Gabriela Moldovan2025-03-242-2/+11
| |
| * tor-proto: Add TODO about rethinking the circuit *Cmd enums.Gabriela Moldovan2025-03-241-0/+6
| |
| * tor-proto: s/CircuitAction::Single/CircuitAction::RunCmd.Gabriela Moldovan2025-03-243-8/+6
| | | | | | | | | | There is no `Multiple` counterpart in `CircuitAction`, so the `Single` variant name doesn't make much sense.
| * tor-proto: Remove now-unused leg_id argument.Gabriela Moldovan2025-03-242-7/+1
| | | | | | | | | | The `LegId` is now added by the caller, when converting the resulting `CircuitCmd`s to `RunOnceCmdInner`.
| * tor-proto: Add docs to SendRelayCell.Gabriela Moldovan2025-03-241-3/+3
| |
| * tor-proto: Replace RunOnceCmdInner with CircuitCmd where appropriate.Gabriela Moldovan2025-03-243-47/+61
| | | | | | | | | | `CircuitCmd`s are a subset of `RunOnceCmdInner`, and don't have a `LegId`.
| * tor-proto: Add CircuitCmd enum.Gabriela Moldovan2025-03-242-1/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A `CircuitCmd`, unlike `RunOnceCmdInner`, doesn't know anything about `LegId`s. The user of the `CircuitCmd`s is supposed to know the `LegId` of the circuit the `CircuitCmd` came from. This is necessary because circuits don't know (and can't know) their own `LegId`. The various `Circuit` operations (e.g. `handle_cell`) will soon be updated to return `CircuitCmd` instead of `RunOnceCmdInner` (because the `RunOnceCmdInner` variants will soon be updated to also have an associated `LegId`, and `Circuit`s don't have access to their `LegId`s). The calling code, which *does* know the `LegId`, will then map `CircuitCmd`s to `RunOnceCmdInner`.
| * tor-proto: Put the leg id of the circuit in CircuitAction::HandleCell.Gabriela Moldovan2025-03-232-7/+12
| | | | | | | | | | | | | | This tells the reactor which circuit leg the input message originated from. Addresses a TODO.
* | tor-proto: send errors to oneshot channel in more placesSteven Engler2025-03-241-16/+38
| |
* | tor-proto: made `StreamTarget::send_sendme` async and fixed a TODOSteven Engler2025-03-241-7/+21
| |
* | tor-proto: remove previously completed TODOsSteven Engler2025-03-241-21/+7
| |
* | tor-proto: fix small TODOSteven Engler2025-03-241-3/+1
|/
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-183-4/+4
| | | | - `rand::thread_rng()` has been deprecated and renamed to `rand::rng()`
* tor-proto: make `Circuit::add_hop` fallibleSteven Engler2025-03-123-13/+28
|
* tor-proto: change `take_single_leg` to return `NotSingleLegError`Steven Engler2025-03-112-4/+3
|
* tor-proto: remove `ConfluxSet::single_leg_check` and add `get_single`Steven Engler2025-03-111-37/+38
|
* tor-proto: begin using `TargetHop` and `HopLocation`Steven Engler2025-03-115-37/+123
| | | | | | | | This doesn't yet change the public API, it just begins the work of plumbing these around throughout `ClientCirc`, `Reactor`, etc. This can't be broken up into smaller commits without causing build failures.
* tor-proto: add methods for resolving `TargetHop` and `TargetLocation`Steven Engler2025-03-112-1/+96
|
* tor-proto: add a non-pub `ClientCirc::legs()` methodSteven Engler2025-03-113-2/+40
|
* tor-proto: combine `single_leg_with_id` and `single_leg`Steven Engler2025-03-113-43/+30
| | | | And the same with `single_leg_with_id_mut` and `single_leg_mut`.
* tor-proto: add methods to `ConfluxSet`Steven Engler2025-03-111-12/+65
| | | | These give more ways of accessing legs.
* tor-proto: change `single_leg_mut` to return `NotSingleLegError`Steven Engler2025-03-112-7/+8
|
* tor-proto: add `NotSingleLegError` for `single_leg_check`Steven Engler2025-03-111-8/+34
|
* tor-proto: s/note/warning in function docs about locking stream map mutex.Gabriela Moldovan2025-03-061-1/+1
|
* tor-proto: s/has_first_hop/has_hops (fmt).Gabriela Moldovan2025-03-061-5/+1
|
* tor-proto: s/has_first_hop/has_hops.Gabriela Moldovan2025-03-063-3/+3
|
* tor-proto: Fix up docs post-refactoring (fmt).Gabriela Moldovan2025-03-061-4/+1
|
* tor-proto: Fix up docs post-refactoring.Gabriela Moldovan2025-03-061-3/+3
|
* tor-proto: Move Circuit to its own module.Gabriela Moldovan2025-03-068-1324/+1392
| | | | | | | | | | | This is mostly code motion + some visibility adjustments. Moving all of these outside of `reactor` makes it easier to see which parts are internal vs which are accessed by the reactor. It also helps us enforce/audit invariants such as 'there should be no contention on the `CircHop::map` mutex' (the stream map is now private to `reactor::circuit`, and therefore nothing inside `reactor` will be directly accessing it).
* tor-proto: Avoid accessing CircHop internals from the reactor.Gabriela Moldovan2025-03-063-2/+16
| | | | This will enable us to move `CircHop` out of `reactor.rs`.
* tor-proto: Avoid accessing Circuit internals from the reactor.Gabriela Moldovan2025-03-062-3/+16
| | | | This will enable us to factor `Circuit` out of `reactor.rs`.
* Merge branch 'ctrl-cmd-docs' into 'main'David Goulet2025-03-031-6/+5
|\ | | | | | | | | tor-proto: Update CtrlCmd and CtrlMsg docs. See merge request tpo/core/arti!2829
| * tor-proto: Update CtrlCmd and CtrlMsg docs.Gabriela Moldovan2025-03-031-6/+5
| | | | | | | | | | | | In aa08ede11fd483cd6dcb4522c431f9e07001717e, the reactor loop was rewritten to unconditionally read from the `CtrlMsg` channel, so we need to adjust the docs.
* | Merge branch 'conflux-cmds' into 'main'David Goulet2025-03-033-13/+73
|\ \ | | | | | | | | | | | | | | | | | | tor-proto: Add CtrlCmd:ShutdownAndReturnCircuit Closes #1876 See merge request tpo/core/arti!2831
| * | tor-proto: Add CtrlCmd::ShutdownAndReturn circuit.Gabriela Moldovan2025-03-031-0/+18
| | | | | | | | | | | | Closes #1876
| * | tor-proto: Add ConfluxSet method for taking the only leg in the set.Gabriela Moldovan2025-03-032-0/+28
| | | | | | | | | | | | | | | | | | | | | This will be used to implement the new `ShutdownAndReturnCircuit` control command. Part of #1876
| * | tor-proto: Use bad_api_usage! instead of internal! where applicable (fmt).Gabriela Moldovan2025-03-031-2/+6
| | |
| * | tor-proto: Use bad_api_usage! instead of internal! where applicable.Gabriela Moldovan2025-03-031-3/+3
| | | | | | | | | | | | | | | Some of these were supposed to be `bad_api_usage`, because they result from API misuse rather than an internal error (bug).