summaryrefslogtreecommitdiff
path: root/crates/tor-proto/src/client.rs
Commit message (Collapse)AuthorAgeFilesLines
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-3/+0
| | | | | | | | | Fixes part of #2193. (Edits from nickm: I selected the cases here that I could verify were correct from immediate context.) Edited-by: Nick Mathewson <[email protected]>
* Merge branch 'relay-streams2' into 'main'David Goulet2025-12-021-165/+35
|\ | | | | | | | | proto: Start handling incoming streams in the relay reactor See merge request tpo/core/arti!3487
| * proto: Remove crate-level STREAM_READER_BUFFER reexportGabriela Moldovan2025-11-241-1/+2
| | | | | | | | All this indirection is making me dizzy.
| * proto: Move a couple of stream-related constants to stream mod (fmt)Gabriela Moldovan2025-11-241-4/+2
| |
| * proto: Move a couple of stream-related constants to stream modGabriela Moldovan2025-11-241-2/+2
| |
| * proto: Move StreamComponents to top-level stream modGabriela Moldovan2025-11-241-20/+1
| |
| * proto: Move StreamTarget to stream moduleGabriela Moldovan2025-11-241-160/+2
| |
| * proto: Make StreamTarget take a generic TunnelGabriela Moldovan2025-11-241-42/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed because we want to reuse `StreamTarget` and `DataStream` on the relay side too, but to do that, we need to abstract away the tunnel/circuit type (prior to this MR, `StreamTarget` was was client-specific, as it used to wrap a client tunnel). Note that `StreamTarget` needs a handle to the client/relay circuit reactor because it needs to be able to shut down the circuit if a protocol error occurs (cells carrying stream data are parsed late, *outside* of the reactor, so if e.g. a cell fails to parse, the `DataReaderImpl` needs to be able to shut it down), and because it needs to be able to inform the reactor of flow control-related events (such as drain rate update).
| * proto: Make the hop in StreamTarget optionalGabriela Moldovan2025-11-241-6/+6
| | | | | | | | For relays, the hop of the StreamTarget will be set to `None`.
| * proto: Move StreamReqInfo to stream moduleGabriela Moldovan2025-11-241-4/+4
| |
| * proto: Make the hop in StreamReqInfo optionalGabriela Moldovan2025-11-241-1/+1
| | | | | | | | We are about to use `StreamReqInfo` for exit streams too.
* | opentelemetry: Instrument a bunch of functions.Wesley Aptekar-Cassels2025-11-241-0/+2
|/ | | | | These are all aimed at figuring out in more detail what's going on in #2079 and related issues.
* proto: Move client handshake into client channel moduleDavid Goulet2025-11-191-0/+1
| | | | | | | | | | | | | This only moves code from src/channel to src/client/channel. It introduces a ClientChanBuilder that is used to launch client specific channel by the public ChanBuilder. The followup commits will add a VerifiedClientChannel and UnverifiedClientChannel in order to again decouple client and relay code from the generic objects. Signed-off-by: David Goulet <[email protected]>
* proto: Move CloseStreamBehavior to top-level stream moduleGabriela Moldovan2025-11-141-1/+1
|
* tor-proto: Track information on when tunnels were last usedNick Mathewson2025-11-121-0/+12
| | | | This is part of an implementation for proposal 368.
* proto: Move StreamMpsc{Sender,Receiver} to stream module (fmt)Gabriela Moldovan2025-10-211-1/+1
|
* proto: Move StreamMpsc{Sender,Receiver} to stream moduleGabriela Moldovan2025-10-211-1/+2
| | | | These will be shared with the relay code.
* proto: Move halfstream under streammapGabriela Moldovan2025-10-211-2/+0
| | | | | | That way we don't need to make halfstream `pub(crate)` (we only really use it in streammap, and in the client reactor, because of the `handle_msg()` kludge).
* proto: Move streammap out of the client moduleGabriela Moldovan2025-10-211-2/+2
|
* proto: Move dumb pipes to top-lvl stream module (fmt)Gabriela Moldovan2025-10-211-1/+1
|
* proto: Move dumb pipes to top-lvl stream moduleGabriela Moldovan2025-10-211-1/+1
|
* proto: Give the relay reactor a stream mapGabriela Moldovan2025-10-211-1/+1
| | | | | | We need it for exits and leaky pipe. Part of #2212
* proto: Rename data cmd checkers to {Inbound,Outbound}DataCmdChecker (fmt)Gabriela Moldovan2025-10-161-1/+2
|
* proto: Rename data cmd checkers to {Inbound,Outbound}DataCmdCheckerGabriela Moldovan2025-10-161-2/+2
| | | | | | The previous "incoming" terminology was rather ambiguous. Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3348#note_3275337
* proto: Reformat imports post-move.Gabriela Moldovan2025-10-161-3/+2
|
* proto: Avoid crate-pub reexports of shared types from the client module.Gabriela Moldovan2025-10-161-1/+2
| | | | | This makes it easier to see which parts are implementation-agnostic (i.e. do not import from crate::client).
* proto: Remove an allow that is no longer neededGabriela Moldovan2025-10-141-1/+0
|
* proto: Move flow_ctrl module under stream (fmt).Gabriela Moldovan2025-10-071-2/+2
|
* proto: Move flow_ctrl module under stream.Gabriela Moldovan2025-10-071-2/+2
| | | | This will be used by exits too, so I am moving it out of `client`.
* Fix several rustdoc links.Nick Mathewson2025-09-161-2/+2
|
* Fix check_doc_features warning.Nick Mathewson2025-09-161-0/+1
|
* proto: Experimental API to install a circuit padder at a hop.Nick Mathewson2025-09-151-0/+24
| | | | | | | | | | | | For now, we're not going to implement hop negotiation: we're still waiting to find a set of padding machines that will be useful for Arti. This API will help facilitate experimentation to find such padding machines. These APIs are under a separate feature (`circ-padding-manual`) to avoid confusing them with the rest of the padding code: we only want them to be exported when the researcher wants to manually install circuit padding.
* tor-proto: remove a `pub(crate) use` from `client::stream`Steven Engler2025-09-101-1/+2
| | | | | For internal types, I think it becomes too much of a mess to export everything through a single module.
* tor-proto: reorganize some flow control modulesSteven Engler2025-09-101-1/+1
| | | | This is all private (or pub(crate)) code.
* proto: Move TunnelId to a separate, shared module.Gabriela Moldovan2025-08-281-50/+0
| | | | | | | | | | | | | The `TunnelId*` types will be reused in the relay reactor (exit relays need to have the concept of a "tunnel ID" because of conflux). Now the `relay::reactor` module only has a single import from `client` (for the `unwrap_or_shutdown` helper, which we should be able to remove soon). From now, we will avoid importing anything from `client` in the `relay` module, and instead prefer refactoring the code as needed (to pull the implementation-agnostic parts outside of `client`). This commit has no functional changes, just code motion.
* proto: Add a circuit module shared between client and relay impls.Gabriela Moldovan2025-08-281-1/+2
| | | | | | | This is just code motion (I suggest reviewing with `--color-moved`). This also moves the implementation-agnostic parts from `tor_proto::client::circuit` to a new `tor_proto::circuit` module.
* proto: Move the `stream` module under `client` (fmt).Gabriela Moldovan2025-08-181-3/+3
|
* proto: Move the `stream` module under `client` (breaking).Gabriela Moldovan2025-08-181-5/+7
| | | | | | | | | | | | The `stream` module is client-specific, for the most part, so I am moving it under `client`. Later on, we will factor out the parts that can be shared with the relay implementation. Note: this is a breaking change as the deleted `stream` module was `pub`. We could've kept the module and reexported from it the public types from `tor_proto::client::stream`, but I think it's better to have this `client` namespacing, because it makes the separation between the client and relay parts clearer.
* proto: Rename the `tunnel` module to `client` (fmt).Gabriela Moldovan2025-08-181-1/+1
|
* proto: Rename the `tunnel` module to `client`.Gabriela Moldovan2025-08-181-0/+977
The implementation from `tunnel` is client-specific, so we are renaming the module accordingly. The more generic parts will be pulled into a separate module in a future commit.