summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | tor-socksproto tests: Use crate::* rather than ad-hoc importsIan Jackson2024-10-011-7/+1
| | | | | | |
| * | | | | | tor-socksproto: Introduce new API (fmt)Ian Jackson2024-10-012-3/+4
| | | | | | |
| * | | | | | tor-socksproto: Introduce new APIIan Jackson2024-10-016-4/+448
| | | | | | |
| * | | | | | tor-socksproto: Add HasHandshakeOutputIan Jackson2024-10-013-1/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Our new API implementation will need this.
| * | | | | | Apply deferred rustfmt churnIan Jackson2024-10-016-30/+21
| | | | | | |
| * | | | | | tor-socksproto: Introduce HandshakeImpl::call_handshake_implIan Jackson2024-10-011-6/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This will support both the new and old API.
| * | | | | | tor-socksproto: Make NextStepImpl an enum (tidy)Ian Jackson2024-10-012-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove redundant {} from construction of NextStepImpl::Finished. (We kept these in the previous commit to reduce the size of the diff there.)
| * | | | | | tor-socksproto: Make NextStepImpl an enumIan Jackson2024-10-013-32/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We never say both "finished" and "reply". Make this explicit. Our new caller API is going to depend on this. Also, notice if the implementation's behaviour implies an infinite loop, and call that an internal error instead.
| * | | | | | tor-socksproto: Introduce NextStepImpl and do drain centrallyIan Jackson2024-10-013-39/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This separates the public API from the internal API, which will allow us to do more work centrally, and defend against various bugs on both sides. The name mirrors a new `NestStep` type we'll introduce as part of a new caller API. For now, we make only one centralisation change: Action.drain is now computed centrally rather than ad-hoc in each protocol implementation branch.
| * | | | | | tor-socksproto: Move `handshake` to be a trait methodIan Jackson2024-10-019-42/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | | | | tor-socksproto: Adjust description of `handshake`Ian Jackson2024-10-012-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speak of "peer" rather than being specific. Also, fix a copypaste mistake: `SocksClientHandshake::handshake`'s doc says it's about `SocksProxyHandshake`. Instead just speak of the "handshake".
| * | | | | | tor-socksproto: Factor out reader constructionIan Jackson2024-10-013-30/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Code flow changes: * We always construct the Reader, even on paths where we didn't previously. That's fine because it's infallible and has no side effects. * In proxy.rs, the quirk with `input[0]` has gone away. We can use the supplied `Reader` and peek the first byte. No overall functional change.
| * | | | | | tor-socksproto: Factor out return value handlingIan Jackson2024-10-016-28/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This centralises the handling of return values, and paves the way for further deduplication. (The two return paragraphs were identical.) There's quite a lot of initial API surface to framework.rs. Some of that is going to be hidden, but we're also going to extend this to do more work. No functional change.
| * | | | | | tor-socksproto: Use .is_empty() in some testsIan Jackson2024-10-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type inference seems fragile when comparing with empty slices. Here's a ticket I filed where an earlier version of the tor-socksproto API branch triggered this problem: https://github.com/rust-lang/rust/issues/130480 The latest version seems to trigger it too.
| * | | | | | safelog: derive Clone and Copy for Sensitive and RedactedIan Jackson2024-10-012-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | educe has bugs that mean it applies a Copy bound to its Clone impl. Anyway, we just want to derive these normally, not do something weird.
| * | | | | | tor-bytes: Restore the message for Error::TruncatedIan Jackson2024-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This variant is deprecated but it still ought to have a message so long as it exists.
| * | | | | | Revert "socks users: detect closed sockets."Ian Jackson2024-10-014-28/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0c595818f713916d94b7b0e4062f953fad7c9799.
| * | | | | | Revert "socks users: copy the correct amount in our drain logic."Ian Jackson2024-10-012-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit dceeb82f7d1154894ab9c7c607d68f8335bb9615.
| * | | | | | Revert "arti SOCKS proxy: Tear down connections when client sends optimistic ↵Ian Jackson2024-10-011-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | data" This reverts commit 87e0109832559dec41a485b268579d58be0de278.
| * | | | | | Revert "rpclib: read SOCKS _after_ processing."Ian Jackson2024-10-011-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8da8b88481c26d49ac96e79165538e01237ec9ed.
* | | | | | | Merge branch 'try-send' into 'main'Ian Jackson2024-10-017-2/+345
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | / / | | |_|_|/ / | |/| | | | Introduce SinkTrySend trait and implement it See merge request tpo/core/arti!2468
| * | | | | tor-memquota: Implement SinkTrySend for mq_queue::SenderIan Jackson2024-10-012-1/+32
| | | | | | | | | | | | | | | | | | | | | | | | Plumbing.
| * | | | | tor-async-utils: Avoid needless nesting of ErasedSinkTrySendErrorIan Jackson2024-10-011-1/+22
| | | | | |
| * | | | | tor-async-utils: Provide tests for ErasedSinkTrySendErrorIan Jackson2024-10-013-0/+69
| | | | | |
| * | | | | tor-async-utils: Implement SinkTrySend for mpsc::SenderIan Jackson2024-10-014-0/+142
| | | | | |
| * | | | | tor-async-utils: Provide new SinkTrySend traitIan Jackson2024-10-012-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the method try_send from mpsc::channel::Sender. We want to be able to replace that type in tor-circmgr with a memquota wrapper, so the call needs to be a trait method. This API is deceptively simple. Implementing it will involve more support machinery for error handling.
| * | | | | tor-memquota: Provide TypedParticipation::try_claim_or_returnIan Jackson2024-10-011-1/+24
|/ / / / / | | | | | | | | | | | | | | | We're going to want this for try_send.
* | | | | Merge branch 'dyn-time' into 'main'Ian Jackson2024-10-0114-17/+380
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Provide a type-erased SleepProvider + CoarseTimeProvider and use it for memquota queues See merge request tpo/core/arti!2460
| * | | | | tor-rtcompat: dyn_time: Combine test cases into module (fmt)Ian Jackson2024-10-011-27/+28
| | | | | |
| * | | | | tor-rtcompat: dyn_time: Combine test cases into moduleIan Jackson2024-10-011-7/+24
| | | | | |
| * | | | | tor-rtcompat: Test case demonstrating downcast_value doesn't dropIan Jackson2024-10-011-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2460#note_3085583
| * | | | | tor-rtcompat: Comments about the implementation of downcast_valueIan Jackson2024-10-011-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2460#note_3085582
| * | | | | tor-rtcompat: Comments about tradeoffs in special casing PreferredRuntimeIan Jackson2024-10-011-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2460#note_3085581
| * | | | | tor-memquota: mq_queue: Provide Sender::time_provider accessorIan Jackson2024-09-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | Nothing uses this yet, but we will do so.
| * | | | | tor-memquota: Erase the CoarseTimeProvider from mq_queue::Sender (fmt)Ian Jackson2024-09-261-1/+6
| | | | | |
| * | | | | tor-memquota: Erase the CoarseTimeProvider from mq_queue::SenderIan Jackson2024-09-264-14/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use tor_rtcompat::DynTimeProvider instead. Ultimately, we're going to want one of these in Channel etc. The CoarseTimeProvider generic argument then becomes pervasive. Instead, erase it. This will involve an indirect function call each time an item is inserted. I think that can't be helped.
| * | | | | tor-rtcompat: Introduce DynTimeProviderIan Jackson2024-09-264-0/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will replace the internal ad-hoc DynCoarseTimeProvider in tor-memquota. We need this to be public because it's going to be shared by many of our protocol elements (eg ClientCirc, Channel, etc.) as they need to use it for their mq queues.
| * | | | | tor-memquota: mq_queue: Take Account by referenceIan Jackson2024-09-262-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It doesn't need an owned value here. (clippy's note about this was defeated by this being a trait method.)
| * | | | | CI: run miri, currently on tor-rtcompatIan Jackson2024-09-268-3/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm about to add some unsafe which I want tested in CI. We must disable two tests.
* | | | | | Merge branch 'nightly-doc-warnings' into 'main'Nick Mathewson2024-10-012-3/+3
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | | | | | | | | | | | | | Fix a couple of lifetime warnings from nightly. See merge request tpo/core/arti!2478
| * | | | | Fix a couple of lifetime warnings from nightly.Nick Mathewson2024-10-012-3/+3
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nightly rustdoc, under some circumstances, issues a warning when you have an elided lifetime that matches a lifetime with a name. (It would prefer that you name the lifetime explicitly.) This does not change the actual lifetime of anything; it only makes some formerly elided lifetimes explicit.
* | | | | Merge branch 'warn_on_nonlocal' into 'main'Nick Mathewson2024-10-019-379/+475
|\ \ \ \ \ | |_|/ / / |/| | | | | | | | | | | | | | Warn on nonlocal addresses in configuration, PT results See merge request tpo/core/arti!2454
| * | | | Mark resolve_listen_port as deprecated.Nick Mathewson2024-09-301-2/+9
| | | | |
| * | | | ptmgr: Forbid managed pts on non-localhostNick Mathewson2024-09-251-0/+7
| | | | |
| * | | | ptmgr: Warn on non-local unmanaged PTsNick Mathewson2024-09-252-0/+12
| | | | |
| * | | | arti: Warn when listening on non-loopback addresses.Nick Mathewson2024-09-252-0/+8
| | | | |
| * | | | tor-config: Add Listen::is_localhost_only.Nick Mathewson2024-09-251-0/+33
| | | | |
| * | | | tor-config: move Listen to its own module.Nick Mathewson2024-09-253-377/+402
| | | | |
| * | | | arti::cfg: Add a note to avoid new uses of a macro.Nick Mathewson2024-09-251-0/+4
| | | | |
* | | | | Merge branch 'misc' into 'main'Ian Jackson2024-10-014-5/+46
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Miscellaneous cleanups, mostly in tor-memquota See merge request tpo/core/arti!2461