aboutsummaryrefslogtreecommitdiff
path: root/crates/arti-rpc-client-core/src/conn.rs
Commit message (Collapse)AuthorAgeFilesLines
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-091-0/+1
| | | | | | | | | | | | 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.
* 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.
* rpc: Rename nb_stream.rs → ll_conn.rsNick Mathewson2026-03-251-1/+1
| | | | | Since we are no longer calling these types "streams" I've decided to revert to the old name for this module.
* rpc: Rename PollingStream → BlockingConnection.Nick Mathewson2026-03-251-2/+2
|
* rpc-client: add support to prefer/require su permissionNick Mathewson2026-03-161-0/+4
|
* rpc: Fix many long lines in docs and commentsIan Jackson2026-03-051-6/+12
|
* rpc: Fix two mis-formatted json! blocksIan Jackson2026-03-051-2/+13
| | | | | | rustfmt doesn't like to touch things inside macros. These were misformatted as a result, with long lines and in one case a missing space.
* rpc: Change Waker implementation to EventLoop.Nick Mathewson2026-03-051-1/+1
| | | | | | | | | | | Per discussion, it makes more sense to have the API be one that gets called when our IO interests change. Additionally, this commit removes the try_reading and try_writing booleans, as previously discussed. I've left a couple of XXXX comments where more documentation or thought is likely needed.
* rpc: API for event-driven IO.Nick Mathewson2026-03-051-1/+1
| | | | | | | This API provides the necessary functionality to use an RpcConn inside a poll-like event loop. This is part of #1856.
* RPC: Explain why UserTag is a separate type.Nick Mathewson2026-03-051-0/+8
|
* RPC: Raname Tag,RequestTag to UserTag.Nick Mathewson2026-03-051-5/+5
|
* rpc: Nonblocking request submit API (Rust only)Nick Mathewson2026-02-261-2/+27
| | | | | | | | | | | This commit finally adds a `RpcConn::submit()` method to send a request without having to wait on it specifically, and an `RpcConn::wait()` method to wait for the next response from _any_ such request. Thanks to the previous patches, this is relatively simple! This is part of #1856.
* rpc: Backend support for pollable requests.Nick Mathewson2026-02-261-1/+16
| | | | | | In order to implement tagged pollable requests, we need a separate response queue for them, and we need to dispatch requests to that queue as appropriate.
* rpc: Refactor connimpl in preparation for pollable requests.Nick Mathewson2026-02-261-0/+7
| | | | | | | | | | | | | | | | | | | | | In order to implement this part of #1856, we will internally divide requests into two kinds: "Waitable" and "Pollable". Waitable requests are the kind that we have now: They are created with an "execute" method. They each have their own response queue and their own condvar, and in order to see if they have any responses, the caller needs to call some kind of request-specific method. Pollable requests are the ones we will add. They are created with a "submit" method, and associated with a user-provided tag. They all share the same queue and the same condvar. To see if any of them have a response, the caller will run a function that returns tagged responses. In order to support this division, this commit: - turns `RequestState` into an enum, - makes `ResponseQueue` into its own type, - Adds a trait that will be implemented by every type that can identify a response queue.
* RPC: Fix documentation about "readers".Nick Mathewson2026-02-041-0/+2
|
* rpc: Replace llconn backend with nb_stream backend.Nick Mathewson2026-02-041-4/+2
| | | | All the tests still pass!
* rpc: Move responsibility for wrapping streams to rpc-client-coreNick Mathewson2026-02-041-0/+4
| | | | | This will be necessary since, in order to make the RPC stuff nonblocking, we'll need a better API than just `Box<dyn Read>` etc.
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-061-1/+1
| | | | Run maint/add_warning
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-7/+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.
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-5/+5
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* rpclib: Improve output for ConnectFailureNick Mathewson2025-02-041-1/+54
| | | | | | | We want to explain better what has happened, not only with the final fatal error, but with any nonfatal errors that occurred in the middle. Closes #1826.
* rpclib: Obey error Display convention wrt sources.Nick Mathewson2025-02-041-17/+16
| | | | | | | In general, we try to obey the convention that an error's Display method does not display that error's sources. Part of #1650.
* rpclib: Move socketpair to a testing module; use it in llconn testsNick Mathewson2025-02-031-32/+2
|
* rpclib: In tests, use an ersatz socketpair on windows.Nick Mathewson2025-02-031-2/+32
| | | | | | | | | | | | | | | Fixes #1831. I'm doing this because switching from the socketpair crate to an ersatz connect-to-localhost socketpair made the test pass. My windows skills are weak, but it appears possible that you aren't supposed to simultaneously have a blocking ReadFile and a blocking WriteFile to a named pipe from separate threads? At least, that's consistent with our findings in !2758. I first saw this hack in perl, when I needed it in 2003. I am displeased that it is still apparently needed in 2025.
* rpclib: make conn::complex use fewer iterations.Nick Mathewson2025-02-031-1/+1
| | | | This was the slowest test in our suite.
* fix: fix typosDimitris Apostolou2025-01-301-1/+1
|
* rpclib: Implement accessors for ConnectFailureNick Mathewson2025-01-291-1/+18
|
* rpclib: New combined error type for RPC connect failures.Nick Mathewson2025-01-291-0/+16
| | | | | This type explains where every error came from, and explains why each declined connect point was declined.
* rpclib: More explanations about internal method usage.Nick Mathewson2025-01-231-3/+5
|
* arti-rpc-client-core: Rename Authentication{Rejected=>Failed}Nick Mathewson2025-01-231-4/+4
| | | | | | | | Also change corresponding message. This way, it will be clear that we're just reporting that Arti gave us an error—not that the error necessarily means that the authentication itself was "wrong".
* rpclib: Avoid overuse of execute_internal_ok.Nick Mathewson2025-01-231-6/+23
| | | | | | | | | | | The execute_internal_ok method converts every error response into an internal error; as such, it's only appropriate when there is no way for a well-behaved Arti instance to give an error response. But we had been using it in a few places where errors were possible under other circumstances. This commit fixes that behavior, and adds documentation to help avoid it.
* arti-rpc-client-core: Use EmptyReply instead of EmptyResponse.Gabriela Moldovan2025-01-231-2/+2
| | | | | | It looks like !2729 and !2722 raced with each other, because we're still using the old name for `EmptyReply` (and so `arti-rpc-client-core` doesn't currently compile on `main`).
* Merge branch 'rpc-cancel-2' into 'main'Nick Mathewson2025-01-231-5/+23
|\ | | | | | | | | | | | | rpc: Implement request cancellation Closes #818 See merge request tpo/core/arti!2722
| * arti-rpc-client-core: Document that dropping a request does not cancel it.Nick Mathewson2025-01-221-2/+4
| | | | | | | | | | | | | | I hope that this limitation is acceptable; the alternative involves some significant refactoring to give Request a Weak reference to RpcConn -- but RpcConn isn't currently kept in an Arc<> at all, and so we'd need some fairly heavy hacking.
| * arti-rpc-client-core: Implement and expose cancellation.Nick Mathewson2025-01-221-3/+19
| |
* | rpclib: Rename params/reply structs for consistency.Nick Mathewson2025-01-211-3/+3
|/ | | | | | | | Our now convention here in rpclib is that a struct holding a request's parameters is called `FooParams`, and a struct holding that request's reply is called `FooReply`. Closes #1586
* rpclib: Clean up after performing cookie authNick Mathewson2025-01-151-0/+8
| | | | | | Previously we never released the intermediary cookie-auth object, which would have left it kicking around on the RPC server side until we finally closed our connection.
* arti-rpc-client-core: Client side of cookie authentication.Nick Mathewson2025-01-151-1/+19
|
* Implement banner for RPC protocol.Nick Mathewson2025-01-091-0/+7
| | | | Closes #1753
* rpc-client: Reject relative paths.Nick Mathewson2024-12-091-0/+5
|
* rpc-client: Initial implementation for RPC connect points.Nick Mathewson2024-12-091-13/+63
| | | | | | | | | This commit covers the major points of the design: Parsing the environment, parsing and resolving connect points, connecting to Arti, and handling errors. There are a few areas that need to be fixed, all marked with XXXXs.
* rpc-client: move Builder to its own module.Nick Mathewson2024-12-091-85/+8
|
* rpclib: Rename RequestCancelled to be accurate.Nick Mathewson2024-10-211-6/+3
|
* rpclib: Add a #[source] annotation.Nick Mathewson2024-10-021-1/+1
|
* Apply 1 suggestion(s) to 1 file(s)Nick Mathewson2024-10-021-1/+1
| | | Co-authored-by: gabi-250 <[email protected]>
* rpclib: Unify code internally generated requestsNick Mathewson2024-09-251-8/+100
| | | | | | | | We now have a single type to represent the error "A request that we made internally didn't get a result we expected." The functions to generate these requests are now centralized too. Closes #1587.
* rpc: Finish an incomplete sentence in a doc.Nick Mathewson2024-09-251-1/+1
|
* rpclib: Rename connect.rs to stream.rsNick Mathewson2024-09-101-2/+2
| | | | | | (This is about DataStreams, so we should make it less confusing. This commit is _just_ about the file renaming, with no associated function renaming.)
* rpclib: FFI for opening data streams.Nick Mathewson2024-09-091-0/+1
| | | | | There's a blocking TODO here about exposing socks error codes that I still need to solve.
* rpclib: Support opening a data stream.Nick Mathewson2024-09-091-0/+6
| | | | | | Requires #1523. Implements #1524.