summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
* | tor-error: Implement ErrorReport for dyn StdError + 'static.Nick Mathewson2025-02-041-0/+6
| | | | | | | | This is needed to Report on the output of `StdError::source`.
* | tor-error: Refor to the correct trait.Nick Mathewson2025-02-041-1/+1
|/
* rpclib: Move socketpair to a testing module; use it in llconn testsNick Mathewson2025-02-034-33/+39
|
* rpclib: In tests, use an ersatz socketpair on windows.Nick Mathewson2025-02-032-3/+35
| | | | | | | | | | | | | | | Fixes #1831. I'm doing this because switching from the socketpair crate to an ersatz connect-to-localhost socketpair made the test pass. My windows skills are weak, but it appears possible that you aren't supposed to simultaneously have a blocking ReadFile and a blocking WriteFile to a named pipe from separate threads? At least, that's consistent with our findings in !2758. I first saw this hack in perl, when I needed it in 2003. I am displeased that it is still apparently needed in 2025.
* rpclib: make conn::complex use fewer iterations.Nick Mathewson2025-02-031-1/+1
| | | | This was the slowest test in our suite.
* Merge branch 'test_extend_ntor-fix' into 'main'David Goulet2025-02-031-1/+1
|\ | | | | | | | | | | | | tor-proto: Ensure rx end of chan reactor output sink is not dropped in test. Closes #1832 See merge request tpo/core/arti!2760
| * tor-proto: Ensure rx end of chan reactor output sink is not dropped in test.Gabriela Moldovan2025-02-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This hopefully fixes #1832. I haven't been able to repro the failure from #1832 locally, but judging from the logs, I suspect it's triggered by interleavings like: - `extend_fut` executes up until `circ.extend_ntor(..).await`, where it's blocked `await`ing a completion notification from the circuit reactor - `reply_fut` starts running: * `CircuitExtender` installs a meta-handler in the circuit reactor, and waits for an `EXTENDED2` cell * `test_extend()` reads a cell from the receiving end of the fake channel's output sink (`rx`) * `test_extend()` sends the `EXTENDED2` cell to the circuit reactor over `CircuitRxSender` * `rx` is dropped - `reply_fut` completes - in the channel reactor's `run_once()`, `select_biased!` resolves to an error, because the receiving end of the `output` sink (`rx`) was dropped. The reactor logs `got sink error: SendError { kind: Disconnected }` (see [`SendError`]), and exits - the circuit reactor exits too, because the receiving end of its `chan_sender` (which was in the channel reactor) was dropped Returning the `rx` of the fake channel's output sink from `reply_fut` *should* stop it from being dropped, and fix #1832. [`SendError`]: https://docs.rs/futures/latest/futures/channel/mpsc/struct.SendError.html#method.is_disconnected
* | Merge branch 'ahf/win32-rpc-fixes' into 'main'Nick Mathewson2025-02-031-1/+4
|\ \ | |/ |/| | | | | rpc: Fix test builds on Windows. See merge request tpo/core/arti!2756
| * rpc: Fix test builds on Windows.Alexander Hansen Færøy2025-01-301-1/+4
| |
* | Merge branch 'rpc_document_internal_optimism' into 'main'Nick Mathewson2025-01-305-29/+23
|\ \ | | | | | | | | | | | | | | | | | | rpc: Document what is actually going on with stream optimism. Closes #1583 See merge request tpo/core/arti!2753
| * | socks.rs: Update documentation; RpcDataStream has been renamed.Nick Mathewson2025-01-301-9/+5
| | |
| * | rpc: Correct API documentation about optimismNick Mathewson2025-01-304-18/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our documentation had dated to an older version of our RPC stream code, where all streams were automatically optimistic. But as explained, our use of "optimistic"ness in RPC stream code is now purely internal, to make it possible to get an DataStreamCtrl. This isn't user-visible in our rpc_conn_open_stream code. Closes #1583
| * | rpc: Document what is actually going on with stream optimism.Nick Mathewson2025-01-301-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | In brief: we _do_ correct implement correct optimistic vs nonoptimistic behavior for RPC streams. Only our documentation was wrong. Subsequent commits will fix our documentation more. See #1583.
* | | Merge branch 'proto-datactl-api-fixes2' into 'main'Nick Mathewson2025-01-304-35/+38
|\ \ \ | | | | | | | | | | | | | | | | tor-proto: Tweak StreamCtrl APIs for RPC. See merge request tpo/core/arti!2755
| * | | proto: deprecate DataStream::circuitNick Mathewson2025-01-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method is experimental, so no semver note is needed. It is redundant with `client_stream_ctrl()?.circuit()?`. (The name and the unconditional return type of this method are probably an error.)
| * | | proto: Rename (experimental) DataStream functions for ctrl accessNick Mathewson2025-01-302-7/+11
| | | | | | | | | | | | | | | | | | | | Since these return a client-specific type, they need a client-specific name before we can stabilize them for RPC.
| * | | proto: Rename ClientDataStreamCtrl::{is_open=>is_connected}Nick Mathewson2025-01-301-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Semantically, the new name matches the behavior much better. (A stream could well count as open if we had sent a RESOLVE but not received a RESOLVED, so we might someday want to have an `is_open` defined for _all_ streams, not just data streams.)
| * | | proto: Rename DataStreamCtrl to ClientDataStreamCtrlNick Mathewson2025-01-303-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | The API for this type, and the fact that it implements ClientStreamCtrl unconditionally, means that it is only for client DataStreams.
| * | | proto: Clarify applicability of ClientStreamCtrl.Nick Mathewson2025-01-301-4/+2
| | |/ | |/|
* | | Merge branch 'reactor-stuff' into 'main'David Goulet2025-01-3010-760/+1187
|\ \ \ | |/ / |/| | | | | | | | tor-proto: Rewrite circuit reactor run_once() loop to use select!. See merge request tpo/core/arti!2747
| * | tor-proto: Remove outdated docs about AsyncMutex use.Gabriela Moldovan2025-01-301-7/+0
| | |
| * | tor-proto: Remove unnecessary time_prov argument.David Goulet2025-01-301-28/+17
| | |
| * | tor-proto: Remove unnecessary Mutex around chan_sender.David Goulet2025-01-301-44/+20
| | |
| * | tor-proto: Resolve clippy warning about mut refs in debug_assert.Gabriela Moldovan2025-01-291-6/+7
| | | | | | | | | | | | | | | | | | It's unclear to me why this warning didn't fire before! The the circuit reactor had this exact same `debug_assert` prior to the refactoring, taking a mutable reference to the `StreamMap`.
| * | tor-proto: Add a clippy allow and corresponding TODO.Gabriela Moldovan2025-01-291-0/+1
| | |
| * | tor-proto: Remove now-unused Reactor::send_outbound().Gabriela Moldovan2025-01-291-74/+0
| | | | | | | | | | | | This is now handled in `Reactor::ready_streams_iterator()`.
| * | tor-proto: Remove old Reactor::run_once().Gabriela Moldovan2025-01-291-66/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is replaced by the new `Reactor::run_once()` impl. Note: this removal is in a separate commit to make the diff of the refactoring commits easier to review (the diff between the old and the new impl is not meaningful because the new impl is practically a rewrite).
| * | tor-proto: Remove now-unused CellStatus enum.Gabriela Moldovan2025-01-291-9/+0
| | | | | | | | | | | | This is replaced by `Option<RunOnceCmdInner>`.
| * | tor-proto: Rewrite circuit reactor run_once() loop to use select! (fmt).Gabriela Moldovan2025-01-292-27/+29
| | |
| * | tor-proto: Rewrite circuit reactor run_once() loop to use select!.Gabriela Moldovan2025-01-299-210/+653
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rewrites the circuit reactor main loop to use `select_biased!` to poll multiple futures simultaneously. The new `run_once()`, like the old, first waits for an initial `CtrlMsg::Create`. Then, it uses a `select_biased!` to poll the `chan_sender` sink and shutdown channel for readiness. When the channel sink is ready, we poll the `control` and `input` channels like before, as well as the new `ready_streams` `Stream` (`ready_streams` is a `futures::Stream` that replaces the previous `send_outbound()` function). Most of the implementation remains unchanged, except the `handle_input`, `handle_cell` and `handle_control` functions no longer send anything on the `chan_sender` channel. Instead, they may do some (synchronous) processing, and send instructions for the remaining work that needs to be done (for example, for writing the cell to the `chan_sender` channel). These instructions are handled at the end of `run_once()`, and are encoded in the `RunOnceCmdInner` enum. What this change does **not** do: * the control channel *still* bypasses congestion control. We could fix this by making the various reactor functions send the `RunOnceCmdInner` commands to `run_once()` via a channel (instead of returning them). This would enable the reactor to stop reading the commands (except for handle `Sendme`, which would be handled separately) if it's blocked on congestion control.
| * | tor-proto: Use SendRelayCell within CtrlMsg::SendRelayCell.Gabriela Moldovan2025-01-293-8/+8
| | |
| * | tor-proto: Add enums for representing run_once() commands.Gabriela Moldovan2025-01-291-0/+104
| | |
| * | tor-proto: Move SendMsgAndInstallHandler handling to a separate function.Gabriela Moldovan2025-01-291-13/+24
| | |
| * | tor-proto: Move the CircuitExtender to a separate module.Gabriela Moldovan2025-01-292-266/+295
| | |
| * | tor-proto: Move CtrlMsg to its own module.Gabriela Moldovan2025-01-292-181/+209
| | | | | | | | | | | | No functional changes, just code motion.
| * | tor-async-utils: Make SometimesUnboundedSink::send_unbounded() pub(crate).Gabriela Moldovan2025-01-291-2/+1
| | | | | | | | | | | | | | | We are about to use this in the circuit reactor (instead of `pollish_send_unbounded`).
* | | fix: fix typosDimitris Apostolou2025-01-3014-20/+20
| |/ |/|
* | Merge branch 'rpc-docs-1' into 'main'Nick Mathewson2025-01-302-20/+104
|\ \ | | | | | | | | | | | | | | | | | | Improve and write a bunch of RPC documentation Closes #1520, #1527, and #1296 See merge request tpo/core/arti!2748
| * | tweak cbindgen documentation.Nick Mathewson2025-01-292-4/+9
| | |
| * | rpclib: Update cbindgen documentation.Nick Mathewson2025-01-292-17/+96
| |/
* | rpclib: Rename ConnPtSource to ConnPtOrigin.Nick Mathewson2025-01-291-11/+11
| |
* | rpclib: Rename WithinDir.{expanded => file}.Nick Mathewson2025-01-291-3/+6
| |
* | rpclib: Move from_env_string_elt onto SearchLocation.Nick Mathewson2025-01-291-4/+6
| |
* | rpclib: Implement accessors for ConnectFailureNick Mathewson2025-01-293-3/+23
| |
* | rpclib: Implement Display for ConnPtDescriptionNick Mathewson2025-01-291-4/+51
| |
* | rpclib: New combined error type for RPC connect failures.Nick Mathewson2025-01-293-9/+52
| | | | | | | | | | This type explains where every error came from, and explains why each declined connect point was declined.
* | rpclib: Pipe connect-point locations through our loading process.Nick Mathewson2025-01-291-22/+77
| |
* | rpclib: Keep track of where each SearchEntry comes from.Nick Mathewson2025-01-291-24/+91
|/ | | | Subsequent commits will pipe this information forward to our errors.
* rpcserver: Remove a stale TODO. (RpcMgr works.)Nick Mathewson2025-01-281-2/+0
|
* rpcserver: Remove stale TODO about authenticationNick Mathewson2025-01-281-3/+0
| | | | (This TODO dates back to the point before we had sessions.)