aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtmock/src
Commit message (Collapse)AuthorAgeFilesLines
* Remove now-unneeded allow(clippy::cognitive_complexity)Jim Newsome2026-07-153-5/+0
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-097-0/+7
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* tor-rtcompat+misc: add `NetStreamProvider::ConnectOptions`Steven Engler2026-06-083-9/+27
| | | | | | | | | This adds the trait type `ConnectOptions` to `NetStreamProvider` and adds this `ConnectOptions` as an argument to `NetStreamProvider::connect()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* Merge branch 'socket-buf-size' into 'main'opara2026-05-213-7/+28
|\ | | | | | | | | | | | | Set socket buffer sizes (`SO_SNDBUF` and `SO_RCVBUF`) for proxy sockets Closes #2500 See merge request tpo/core/arti!3957
| * tor-rtcompat+misc: add `NetStreamProvider::ListenOptions`Steven Engler2026-05-073-7/+28
| | | | | | | | | | | | | | | | | | This adds the trait type `ListenOptions` to `NetStreamProvider` and adds this `ListenOptions` as an argument to `NetStreamProvider::listen()`. You probably want to look at the changes in tor-rtcompat first, then the rest of this commit is updating the various places we use `NetStreamProvider`.
* | Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-1/+1
|/ | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* rtcompat, rtmock: Port to web-time-compat.Nick Mathewson2026-03-265-13/+14
|
* Fix typosTobias Stoeckmann2026-03-241-1/+1
| | | | Typos found with codespell
* rtmock, chanmgr: Allow use of deprecated try_next() in testsGabriela Moldovan2026-03-031-0/+3
| | | | | | | | futures 0.3.32 has deprecated UnboundedReceiver::try_next() in favor of UnboundedReceiver::try_recv(), but try_recv() was only introduced in 0.3.32, so using it would cause our minimal versions checks to fail (rightfully so, because our code wouldn't build with futures 0.3.x for x < 32).
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* rtcompat: Return certificates as Cow.Nick Mathewson2026-02-021-4/+5
|
* rtmock: Implement server support.Nick Mathewson2026-01-291-10/+44
|
* rtcompat: new server-related members on TlsProvider trait.Nick Mathewson2026-01-292-1/+16
| | | | | These are as yet unimplemented; there's a stub type for the providers (nativetls) that won't actually have them.
* rtcompat: new own_certificate method on CertifiedConn traitNick Mathewson2026-01-291-0/+6
|
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-067-7/+7
| | | | Run maint/add_warning
* tor-rtmock-simple-time-typos: Fix typosNiel Duysters2025-10-011-3/+3
|
* 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.
* tor-rtmock: MockTimeCore: fix docsIan Jackson2025-08-121-2/+2
|
* tor-rtmock: Slightly clean up CrateGetters macroIan Jackson2025-08-121-4/+5
| | | | | | | I want to use this as an example in a talk. Add a blank line that makes it more readable, and generate only one impl block with many methods.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-077-21/+17
| | | | | | | | | | | | | | 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.
* Update code for Edition 2024Nick Mathewson2025-08-071-13/+21
| | | | | | | | | | | | | | | | | | 1. Run cargo fix --edition 2. Selectively revert the "if let"->"match" changes. These changes are meant to protect us from the lifetime changes for "if let" bindings in Rust 2024. But we're not actually relying on the old lifetime rules anywhere, and the match syntax here is quite ugly. 3. Automatically revert `$pat:expr_2021` to `$pat:expr`. (We don't actually want to restrict the expression syntax that our macros accept). Done with `git grep -l expr_2021 | xargs perl -i -pe 's/expr_2021/expr/g;'` 4. Run cargo fmt.
* tor-rtcompat, tor-rtmock: Allow unused functions.Gabriela Moldovan2025-07-071-0/+1
| | | | These only serve as a compile-time check.
* Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
| | | | See #2060.
* tor-rtmock: Use subthread_spawn for spawn_blocking.Wesley Aptekar-Cassels2025-06-091-38/+6
| | | | Fixes: #2033
* *: use std::io::Error::other in many placesNick Mathewson2025-05-152-11/+4
| | | | | | | The `IoError::other` function is an easier way to say `IoError::new(IoErrorKind::Other, ...)`. It's been around since 1.74, but clippy started warning about the more verbose version in 1.87.
* rtmock: use Option::replace instead of mem::replaceNick Mathewson2025-05-151-8/+6
| | | | | Option::replace has been around since 1.31, but the clippy warning is new.
* tor-rtcompat: task tests: Allow a clippy lintIan Jackson2025-04-101-0/+1
| | | | | This doesn't seem to happen with my local compiler. Anyway, suppress it. I don't think we want to split up this function.
* tor-rtcompat: task: Break out subthread_yieldIan Jackson2025-04-101-30/+36
| | | | | This gets rid of a clippy complaint about subthread_block_on_future being too complicated.
* tor-rtcompat: task tests: Allow a clippy lintIan Jackson2025-04-101-0/+1
|
* tor-rtcompat: BlockOn: relax bounds on reenter_block_onIan Jackson2025-04-092-2/+2
| | | | The future no longer needs to be `Send + 'static`.
* tor-rtmock: task: subthread_block_on_future; Yield a bit moreIan Jackson2025-04-091-2/+18
|
* tor-rtmock: task tests: New subhtread_pingpong testIan Jackson2025-04-091-1/+43
| | | | | | | | This test demonstrates that the intended use pattern compiles and works. It couldn't exist until now because we couldn't conveniently make a `Send + 'static` future out of `rx.next()`.
* tor-rtmock: task: Redo subthread_block_on_future; poll on the subthread (fmt)Ian Jackson2025-04-091-14/+3
|
* tor-rtmock: task: Redo subthread_block_on_future; poll on the subthreadIan Jackson2025-04-091-68/+62
| | | | | | | | | | | | | | | | | | Previously we put the future into the data structure, had the exeuctor poll it there, and only woke up the subthread when the future was ready. Now, instead, we put a new TaskFutureInfo variant into the data structure, and the executor context switches to the subthread every time. Then we poll the future on the subthread. Moving the future into the data structure meant we had to do use a proxy future to store the return value. Now that's not needed any more. Now the future doesn't need to be Send + 'static. Fixes #1933.
* tor-rtmock: task: Minor refactoringIan Jackson2025-04-091-4/+6
| | | | | | Eliminate the data_ variable and instead use a block scope. This seems a bit nicer, and will align slightly better with forthcoming changes.
* tor-rtmock: task: import Left and RightIan Jackson2025-04-091-3/+3
|
* tor-rtmock: task: impl Debug for TaskFutureInfoIan Jackson2025-04-091-1/+3
|
* tor-rtmock: task: Break out Waker::make_wakerIan Jackson2025-04-091-5/+10
| | | | We're going to introduce a new call site for this.
* tor-rtmock: Improve a commentIan Jackson2025-04-091-1/+6
| | | | Be clearer that `fut` is only `None` during the main loop.
* tor-rtmock: Fix a commentIan Jackson2025-04-091-1/+1
| | | | | | SubthreadFuture was a type in some early version of this branch, that it's not in-tree now. subthread_spawn returns impl Future and the concrete type is a channel receiver.
* AF_UNIX terminology: Rename two error structsIan Jackson2025-03-241-2/+2
| | | | | | We change `NoUnixAddressSupport` to `NoAfUnixSocketSupport` because it doesn't make much sense to talk about support for the addresses separately from support for the sockets.
* tor-rtmock: Add since= to deprecateds (formatting)Ian Jackson2025-03-061-1/+2
|
* tor-rtmock: Add since= to deprecatedsIan Jackson2025-03-062-2/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2843#note_3169975
* tor-rtmock: Actually apply deprecated attr to deprecated time.rsIan Jackson2025-03-063-5/+15
|
* tor-rtcompat: Rename spawn_thread to spawn_blockingIan Jackson2025-03-042-9/+9
| | | | Let's use Tokio terminology here.
* tor-rtcompat: Remove the TODO re #1835Ian Jackson2025-03-041-3/+0
| | | | This is the TODO we are fixing with this MR.
* tor-rtcompat: Explain Sendness of reenter_block_on futureIan Jackson2025-03-041-0/+1
| | | | | | | Prompted by https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2810#note_3167975 Also allow ourselves the option of changing this in the future.