summaryrefslogtreecommitdiff
path: root/crates/tor-socksproto/src
Commit message (Collapse)AuthorAgeFilesLines
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Remove unnecessary `doc(cfg(...))` attributesNeel Chauhan2025-12-041-7/+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]>
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-065-5/+5
| | | | Run maint/add_warning
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-073-11/+7
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* socksproto: Grammar fix in comment.Nick Mathewson2025-07-091-1/+1
|
* Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-091-2/+2
| | | | Made with https://crates.io/crates/typos-cli
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* fix `clippy::unneeded_struct_pattern`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Example: ```text warning: struct pattern is not needed for a unit variant --> crates/hashx/src/program.rs:165:32 | 165 | Instruction::Target { .. } => Opcode::Target, | ^^^^^^^ help: remove the struct pattern | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern note: the lint level is defined here --> crates/hashx/src/lib.rs:9:9 | 9 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::unneeded_struct_pattern)]` implied by `#[warn(clippy::all)]` ```
* fix `clippy::doc_overindented_list_items`Steven Engler2025-04-031-1/+1
| | | | | | | | | | | | | | | | | | | | Example: ```text warning: doc list item overindented --> crates/arti-rpc-client-core/src/conn/connimpl.rs:322:9 | 322 | /// indicates that no more messages will be received for this request. | ^^^ help: try using ` ` (2 spaces) | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items note: the lint level is defined here --> crates/arti-rpc-client-core/src/lib.rs:8:9 | 8 | #![warn(clippy::all)] | ^^^^^^^^^^^ = note: `#[warn(clippy::doc_overindented_list_items)]` implied by `#[warn(clippy::all)]` ```
* Merge branch 'mod-module-files' into 'main'Nick Mathewson2025-01-071-0/+1
|\ | | | | | | | | clippy: deny `mod_module_files` See merge request tpo/core/arti!2689
| * clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | | | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* | fix: fix typosDimitris Apostolou2025-01-061-2/+2
|/
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* tor-socksproto: fix "check_doc_features" warningSteven Engler2024-10-011-0/+4
|
* tor-socksproto: Handle 0-byte reads (EOF) correctly (fmt)Ian Jackson2024-10-011-1/+3
|
* tor-socksproto: Handle 0-byte reads (EOF) correctlyIan Jackson2024-10-013-4/+24
| | | | | | | This restores the functionality of socks users: detect closed sockets. 0c595818f713916d94b7b0e4062f953fad7c9799 which we reverted as part of rebasing this branch onto main.
* fixup! tor-socksproto: Fix doc comment for new_preciseIan Jackson2024-10-011-6/+3
|
* tor-socksproto: Fix doc comment for ReadPrecisionIan Jackson2024-10-011-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2436#note_3081884
* tor-socksproto: Fix doc comment for new_preciseIan Jackson2024-10-011-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2436#note_3081885
* tor-socksproto: Code motion to tidy upIan Jackson2024-10-012-31/+25
|
* tor-socksproto: Deprecate old APIIan Jackson2024-10-013-5/+11
|
* tor-socksproto: Introduce handshake_for_tests method (fmt)Ian Jackson2024-10-013-5/+20
|
* tor-socksproto: Introduce handshake_for_tests methodIan Jackson2024-10-014-36/+44
|
* tor-socksproto: Introduce into_output_forbid_pipeliningIan Jackson2024-10-012-0/+26
|
* tor-socksproto tests: Run test cases via new API in various modesIan Jackson2024-10-011-4/+117
|
* 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-013-4/+436
|
* tor-socksproto: Add HasHandshakeOutputIan Jackson2024-10-013-1/+37
| | | | Our new API implementation will need this.
* Apply deferred rustfmt churnIan Jackson2024-10-014-24/+17
|
* 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-015-41/+33
| | | | | | | | | | | 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-014-28/+127
| | | | | | | | | | | 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.
* tor-bytes: Rename Truncated to Incomplete, and restore old Truncated as ↵Ian Jackson2024-09-113-3/+9
| | | | | | | | | deprecated Incomplete is a better name. This lets us use Truncated for the old, deprecated, conflation of "Incomplete" with what is now "MissingData".
* tor-bytes: Add a Reader constructor for tor-socksproto's use caseIan Jackson2024-09-112-8/+8
| | | | | | | Here we add the constructor, and document it, and change the call sites. No functional change yet.
* tor-bytes: Add a deficit field to Error::TruncatedIan Jackson2024-09-103-3/+3
| | | | This will allow us to fix #1592, but it doesn't do so yet.
* socksproto: Add a const for suggested buffer length.Nick Mathewson2024-09-091-0/+6
| | | | | Ticket #1509 will probably get rid of this constant, but for now we may as well put it in one place.
* rpclib: Support opening a data stream.Nick Mathewson2024-09-091-1/+2
| | | | | | Requires #1523. Implements #1524.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Run maint/add_warning.Nick Mathewson2024-03-134-0/+4
|
* deny clippy::unchecked_duration_subtractiontrinity-1686a2024-02-291-0/+1
|
* Run maint/add_warning to add lint block everywhereIan Jackson2023-08-234-0/+4
|
* Run add_warnings on all files.Nick Mathewson2023-08-041-2/+2
|