summaryrefslogtreecommitdiff
path: root/crates
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | tor-ptmgr: move some code to a new 'managed' moduleSteven Engler2024-08-203-312/+331
| | | | | | | | | | | | | | | | | | | | | | | | Code that's related to managed transports has been moved to a new 'managed' module. This includes the PT reactor since it's not needed for unmanaged transports.
| * | | tor-ptmgr: fix warnings when 'tor-channel-factory' isn't enabledSteven Engler2024-08-202-3/+7
| | | |
| * | | tor-ptmgr: added the `TransportOptions` enumSteven Engler2024-08-202-43/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a little nicer and more type-safe to work with than `TransportConfig`. It would have been nice to change `TransportConfig` directly instead, but it would slightly change arti_client's public API, and would require an extra field in the `[[bridges.transports]]` toml table.
* | | | Merge branch 'peekable-poll-set' into 'main'Jim Newsome2024-08-2110-291/+496
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | Add and use `PeekableStream` and `UnobtrusivePeekableStream` See merge request tpo/core/arti!2345
| * | | StreamPollSet: disallow polling ready streamsJim Newsome2024-08-212-30/+46
| | | |
| * | | StreamMap: Use StreamUnobtrusivePeeker instead of PeekableJim Newsome2024-08-212-4/+9
| | | |
| * | | Expose stream_peekJim Newsome2024-08-212-6/+18
| | | |
| * | | PeekFuture: implement for all PeekableStreamJim Newsome2024-08-211-5/+6
| | | |
| * | | StreamUnobtrusivePeeker: implement PeekableStream and UnobtrusivePeekableStreamJim Newsome2024-08-213-41/+15
| | | |
| * | | tor-proto: Use PeekableStream to get rid of redundant bufferingJim Newsome2024-08-213-235/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Update `StreamPollSet` to require that its streams implement `PeekableStream`, and to not do its own buffering of values read from the stream. This avoids an extra layer of buffering for streams that already buffer a value, and makes the interior state a little simpler and more robust. It does have a downside of making the API a little less convenient, since the caller must do its own `poll_peek` call if it wants a reference to the item. * Update `StreamMap` to implement `PeekableStream` for `OpenStreamEntStream`, as it must to satisfy the updated `StreamPollSet` API. We have to somewhat constrain the `poll_ready_streams_iter` API to no longer return both a reference to the stream and the message. I don't see a way to return both while satisfying the borrow checker. Luckily we don't really need both anymore. * Update the Circuit reactor to handle the updated `StreamMap::poll_ready_streams_iter` API.
| * | | tor-async-utils: add traits PeekableStream and UnobtrusivePeekableStreamJim Newsome2024-08-212-0/+129
| | |/ | |/|
* | | Merge branch 'ticket-1504' into 'main'Nick Mathewson2024-08-212-12/+7
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | llcrypto: Make `blind_keypair` build without hsv3-client. Closes #1504 See merge request tpo/core/arti!2341
| * | | keymanip: Make blind_pubkey exist unconditionallyNick Mathewson2024-08-212-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it exists unconditionally so that we can have our assertion for public key consistency happen unconditionally. (Blinding secret keys is not remotely in the critical path, so I'm not concerned about the critical path.) From a suggestion from Gabi on !2341.
| * | | keymanip: Use doc(cfg(...)) in place of "Availability" sectionsNick Mathewson2024-08-211-8/+2
| | | |
| * | | llcrypto: Make `blind_keypair` build without hsv3-client.Nick Mathewson2024-08-211-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `blind_keypair` function should only call `blind_pubkey` when it is present. Also, fix the documentation: blind_keypair is a hsv3-service function, not a hsv3-client function. Closes #1504.
* | | | rpclib: Allow ConnectionClosed in arti_socket_closed testNick Mathewson2024-08-211-0/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test is supposed to check the case where we launch a bunch of requests but the socket is dropped before we get a response. Different operating systems handle 'drop' a bit differently, and schedule threads differently, so we shouldn't be surprised at slightly different errors here. In particular, OSX is more prone to deliver the close as a proper "close" rather than an EPIPE or such, which previously broke this test. Closes #1510.
* | | Merge branch 'noop-tracker-2' into 'main'Ian Jackson2024-08-219-134/+448
|\ \ \ | | | | | | | | | | | | | | | | Make arrangements in tor-memquota for memory tracking to be optional See merge request tpo/core/arti!2351
| * | | tor-memquota: IfEnabled: Complete a thought in a commentIan Jackson2024-08-211-1/+3
| | | | | | | | | | | | | | | | | | | | Reported at https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2351#note_3062292
| * | | tor-memquota: Pass EnabledToken to HasMemoryCost methodIan Jackson2024-08-192-17/+29
| | | |
| * | | tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-196-19/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will hopefully allow much caller code to be compiled out. The users (IsParticipant impls) don't generally need to bother with it - they can just ignore it.
| * | | tor-memquota: Put EnabledToken in various structs, including the reclaimerIan Jackson2024-08-193-4/+26
| | | |
| * | | tor-memquota: Allow memory tracking to be compiled outIan Jackson2024-08-196-6/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now if we run doctests without the feature enabled, we test that a no-op MemoryQuotaTracker works. Those tests aren't currently run in CI, but they will be after !2350.
| * | | tor-memquota: Support a no-op MemoryQuotaTrackerIan Jackson2024-08-194-51/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Wrap up most of the structures in IfEnabled. Sadly this diff is very noisy. I experimented with macros for the little enabled check at the start of each function but they didn't really help. We don't test this yet. We'll do a smoke test of this later.
| * | | tor-memquota: Introduce self_ variables in mtracker.rs (fmt)Ian Jackson2024-08-191-1/+4
| | | |
| * | | tor-memquota: Introduce self_ variables in mtracker.rsIan Jackson2024-08-191-48/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're going to bind self_ to something more complicated, in each of these functions, and that's what all these field references etc. will need to refer to. Do this mechanical change first for clarity.
| * | | tor-memquota: Introduce IfEnabled and EnabledTokenIan Jackson2024-08-193-0/+84
| | | | | | | | | | | | | | | | EnabledToken is pub because it's going to appear in public APIs.
| * | | tor-memquota: find_in_tracker: Allow internal use of non-unit errorsIan Jackson2024-08-191-6/+6
| | | |
| * | | tor-memquota: pre-apply rustfmt churnIan Jackson2024-08-192-4/+14
| |/ / | | | | | | | | | This will make some later diffs easier to read.
* | | Merge branch 'rpc-delegate' into 'main'Nick Mathewson2024-08-213-32/+138
|\ \ \ | | | | | | | | | | | | | | | | rpcbase: Implement RPC method delegation support. See merge request tpo/core/arti!2342
| * | | rpcbase: Implement RPC method delegation support.Nick Mathewson2024-08-143-32/+138
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (Couldn't use Deref here, since we needed to get an Arc.) Only one delegation target per object is permitted for now. This will help with #1523.
* | | | relay: Add basic configuration and builderDavid Goulet2024-08-204-4/+267
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the basic TorRelayConfig object along a builder in order to create a TorRelay object. At this commit, the configuration object only holds a "StorageConfig" which is a simple starting point which will allow to expand to a KeyMgr and then a ChanMgr along more configuration. There is also no custom Error for the crate at this point. Fixes #1534 Signed-off-by: David Goulet <[email protected]>
* | | tor-log-ratelim: test: add logstate testskn0sys2024-08-201-0/+64
| |/ |/| | | | | | | | | This commit adds the display_recovery and display_problem tests. Line coverage is increased from 0 to 96.97 percent.
* | tor-circmgr: removed unused 'skip_guard_subnet_check' workaround in testsSteven Engler2024-08-151-18/+5
| |
* | tor-circmgr: removed unused "chosen exit" functionalitySteven Engler2024-08-153-159/+18
| |
* | Merge branch 'flow-ctrl-future' into 'main'Jim Newsome2024-08-155-143/+241
|\ \ | | | | | | | | | | | | tor-proto: Encapsulate flow-control See merge request tpo/core/arti!2340
| * | Circuit reactor: Update comments about outbound message handlingJim Newsome2024-08-151-3/+7
| | |
| * | Circuit reactor: remove `'hop_streams` loopJim Newsome2024-08-131-33/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As clippy points out otherwise, this no longer actually loops. Since the iterator already guarantees that the messages it produces are ready to send with respect to flow control, and we've already validated that we can send with respect to the circuit window, the loop, we can always handle the first item from the iterator. i.e. this changes a `while let` to an `if let`.
| * | Circuit reactor: remove `'outer` loopJim Newsome2024-08-131-55/+50
| | | | | | | | | | | | This is no longer needed. Removing it shouldn't change any behavior.
| * | Circuit reactor: don't process streams when we don't have circuit windowJim Newsome2024-08-131-18/+11
| | | | | | | | | | | | | | | | | | | | | When we've exhausted circuit-level SENDME window, iterating over streams is likely to be a waste of CPU. Theoretically we might be able to send some messages that don't count towards windows, but on balance it doesn't seem worth it.
| * | StreamMap: apply stream flow control before making messages availableJim Newsome2024-08-132-17/+83
| | | | | | | | | | | | | | | | | | This prevents us from having to iterate over streams blocked on flow control inside the circuit reactor, and potentially allows further simplification.
| * | tor-proto: Encapsulate flow-controlJim Newsome2024-08-135-59/+132
| | | | | | | | | | | | | | | | | | Encapsulate flow-control into a separate object that partially abstracts away the difference between window-based (legacy) flow control and xon-based (prop324) flow control.
| * | Circuit reactor: remove unnecessary circ window precheckJim Newsome2024-08-131-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Since we no longer have an outbound queue for each hop, and instead return an error here if there is insufficient circuit window to send a message, there's no need to pre-check whether we have sufficient window. If there's insufficient circuit window, we'll still return an error slightly later, after failing to take from the circuit window.
| * | StreamMap: rm stray commentJim Newsome2024-08-131-3/+0
| | |
* | | tor-memquota: mq_queue: tests: Replace eprintln with debugIan Jackson2024-08-151-1/+1
| | | | | | | | | | | | We use `debug!` (tracing logging) everywhere else. Use it here too.
* | | tor-memquota: mq_queue: tests: fill_and_empty: check balanceIan Jackson2024-08-151-0/+3
| | |
* | | tor-memquota: mq_queue: tests: break out check_zero_claimed and fix bugIan Jackson2024-08-151-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Each queue has two `Participation`s, not just one. This didn't matter in the `lifecycle` test, because one of the two Participations was never touched since it was cloned, and a fresh clone starts out with a cache of zero. But we're about to reuse this code in a context where both Participations end up with a cache.
* | | tor-memquota: mq_queue: impl Default for MpscUnboundedSpecIan Jackson2024-08-151-1/+1
| | |
* | | tor-memquota: mq_queue: Provide `new` constructors for SpecsIan Jackson2024-08-152-3/+8
| | | | | | | | | | | | | | | Discussed here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059928
* | | tor-memquota: mq_queue: Fix doc for `MpscSpec`Ian Jackson2024-08-151-2/+2
| | | | | | | | | | | | It's not a unit. It's `MpscUnboundedSpec` that's a unit
* | | tor-memquota: mq_queue: Rename Mpsc to MpscSpecIan Jackson2024-08-151-12/+12
| | | | | | | | | | | | | | | | | | | | | And MpscUnboundedSpec too. As discussed in https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059516