aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-rtcompat/src
Commit message (Collapse)AuthorAgeFilesLines
...
* tor-rtmock: dyn_time tests: rustfmtIan Jackson2024-10-081-3/+1
|
* tor-rtmock: dyn_time tests: Check DropCount on type-mismatch pathIan Jackson2024-10-081-1/+7
|
* tor-rtmock: dyn_time tests: Make try_downcast_string return S, not implIan Jackson2024-10-081-3/+3
| | | | | This will make it possible to use on a DropCounter and get a DropCounter back.
* tor-rtmock: dyn_time tests: Break out try_downcast_stringIan Jackson2024-10-081-8/+8
|
* tor-rtmock: dyn_time tests: Rename try_downcast_dc from chkIan Jackson2024-10-081-2/+2
| | | | This will be clearer
* Merge branch 'dyn-time' into 'main'Ian Jackson2024-10-018-3/+323
|\ | | | | | | | | 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-rtcompat: Introduce DynTimeProviderIan Jackson2024-09-262-0/+235
| | | | | | | | | | | | | | | | | | 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-261-1/+3
| | | | | | | | | | | | 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-267-3/+12
| | | | | | | | | | | | I'm about to add some unsafe which I want tested in CI. We must disable two tests.
* | tor-rtcompat: Suppress a dead code warningIan Jackson2024-09-301-0/+3
|/ | | | | | | | | | | | | | | Fixes cargo check --all-features -p tor-async-utils --all-targets which otherwise prints warning: function `new_unnamed_socketaddr` is never used --> crates/tor-rtcompat/src/unix.rs:14:15 | 14 | pub(crate) fn new_unnamed_socketaddr() -> std::io::Result<SocketAddr> { | ^^^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-3/+2
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* rtcompat: Finalize names for general::SocketAddr.Nick Mathewson2024-09-242-44/+52
|
* rtcompat: Expose FakeStream and friends; fix compilation in tor-rtmockNick Mathewson2024-09-243-10/+8
| | | | | It turns out that these types are generally useful, and that they are in fact needed for tor-rtmock to compile without a PreferredRuntime.
* rtcompat: Fix some rustdoc links.Nick Mathewson2024-09-244-6/+6
|
* rtcompat: remove async_trait from NetStreamListener.Nick Mathewson2024-09-244-5/+0
| | | | (The trait no longer has any async methods.)
* Make Runtime require NetStreamProvider<unix::SocketAddr>Nick Mathewson2024-09-244-8/+27
|
* rtcompat: initial implementation for "Abstract" addresses.Nick Mathewson2024-09-242-0/+147
| | | | | This is feature-complete, but will need tests. I'm holding off at this point so we can discuss naming on these types.
* rtcompat: Require Sync and 'static for NetStreamListener::IncomingNick Mathewson2024-09-242-2/+6
|
* rtcompat: Add NetStreamProvider<Unix> to CompoundRuntimeNick Mathewson2024-09-243-39/+106
|
* rtcompat: NetStreamProvider<unix::SocketAddr> for non-unix platformsNick Mathewson2024-09-244-0/+108
| | | | | | | Since there is no way to construct a unix::SocketAddr on these platforms, it's harmless to provide an implementation for NetStreamProvider. What's more, doing so greatly simplifies our AbstractAddr implementation.
* Implement NetStramProvider<Unix> for async_std.Nick Mathewson2024-09-241-0/+23
|
* async_std: Perpare macro for use with Unix streams.Nick Mathewson2024-09-241-33/+33
|
* async_std: start a macro to implement wrappers for stream typeNick Mathewson2024-09-241-71/+79
| | | | | As before, this commit does nothing interesting: it's a separate commit because it reindents a lot of code.
* rtcompat: Implement NetStreamProvider<Unix> for tokio.Nick Mathewson2024-09-241-4/+60
|
* tokio: Perpare macro for use with Unix streams.Nick Mathewson2024-09-241-24/+31
|
* tokio: start a macro to implement wrappers for stream typeNick Mathewson2024-09-241-67/+74
| | | | | This commit does nothing interesting yet: it's a separate commit because it reindents a lot of code.
* rtcompat: Add ADDR parameter to NetStream{Provider,Listener}Nick Mathewson2024-09-241-11/+11
| | | | | | | | | This change will let us make a NetStreamProvider that works for AF_UNIX addresses, and for "abstract" addresses. I've decided to let this parameter have a default value of `std::net::SocketAddr` for now. We can remove the default later if we decide it's confusing.
* Documentation updates for "NetStreamProvider" renameNick Mathewson2024-09-242-19/+21
| | | | | | Stop referring to TCP streams in its documentation; update other documentation to refer to NetStreamProvider rather than TcpProvider.
* rtcompat: Rename TcpProvider to NetStreamProvider.Nick Mathewson2024-09-246-40/+40
| | | | | | | | | | | | | | (And similarly rename TcpListener to NetStreamListener, along with their TcpStream/TcpListener associated types.) These types are about to become generic over addresses, and therefore shouldn't be named after TCP. Renaming was done mostly with Rust Analyzer, except for some macros that needed to be hand-edited. (I'll revise the comments in the next commit; this one is all about renaming.)
* rtcompat: Remove accept() from TcpListenerNick Mathewson2024-09-244-11/+1
| | | | | | | | | | It's redundant with the incoming() method (which turns the TcpListener into a Stream of connections), and nothing actually used it outside of tests. Removing this method allows us to simplify our TcpListener code a good deal, as can be seen by some of the implementations we removed from our example and testing code.
* rtcompat: Add definitions for unix::SocketAddr.Nick Mathewson2024-09-242-0/+96
|
* rtcompat: Add an extension trait for building modified RuntimesNick Mathewson2024-09-242-1/+68
| | | | | | | With this extension trait, we no longer need to construct `CompoundRuntime` directly outside of tor-rtcompat. This in turn will make it a little less painful when we have to add more generics to CompoundRuntime.
* Discourage use of `tor_rtmock_test_with_*` macrosIan Jackson2024-08-281-0/+16
| | | | New tests should usually use tor_rtmock::MockRuntime.
* Fix new "clippy::needless-maybe-sized" warning on nightlyNick Mathewson2024-07-281-2/+2
| | | | | This warning complains when we say `where T: SomeTrait + ?Sized` when `SomeTrait` is inherently Sized.
* tls: Support export keying material (RFC 5705)David Goulet2024-06-185-0/+51
| | | | | | | | | | | | | Add a function to get the keying material as detailed by RFC 5705. Because native-tls doesn't have such support, there is a place holder panic!() for now. This means that for the forseable future, relay would only work with rustls until we figure out a solution for native-tls. Closes #1432 Signed-off-by: David Goulet <[email protected]>
* rtcompat: Set disable_built_in_roots With native_tls.Nick Mathewson2024-06-131-0/+4
| | | | | | | When using openssl on Linux, this saves us about 1.4 MB due to not loading the default CAs and CRLs (which Tor doesn't use.) Addresses part of #1027.
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Add a note about CryptoProvicder.Nick Mathewson2024-04-221-0/+4
|
* Upgrade to futures-rustls 0.26.0, rustls 0.23.5.Nick Mathewson2024-04-221-0/+14
| | | | | | | | | The rustls upgrade will solve #1377 and CVE-2024-32650. Note that we've had to patch our RustlsProvider impl a bit in order to keep the tests passing. See comments. Closes #1377.
* tor-rtcompat: Add CoarseTimeProvider to docs for Runtime traitIan Jackson2024-04-151-0/+1
| | | | I overlooked this, apparently.
* tor-rtcompat: Rename coarsetime module to coarse_timeIan Jackson2024-03-253-3/+3
| | | | | Modules with the same name as external crates don't work well with our MSRV.
* tor-rtcompat: coarsetime: Add a comment about doc statusIan Jackson2024-03-251-0/+4
|
* tor-rtcompat: Make Runtime imply CoarseTimeProvider, etc.Ian Jackson2024-03-251-0/+2
| | | | We must also impl CoarseTimeProvider for mocked runtimes.
* tor-rtcompat: implement_opaque_runtime impls CoarseTimeProviderIan Jackson2024-03-251-0/+7
| | | | Now all our non-mock runtime types impl CoarseTimeProvider.
* tor-rtcompat: CompoundRuntime: Add a CoarseTimeProvider, and impl (fmt)Ian Jackson2024-03-253-8/+29
|