summaryrefslogtreecommitdiff
path: root/crates/arti-rpc-client-core
Commit message (Collapse)AuthorAgeFilesLines
* Bump arti- and tor- crates to 0.23.0Nick Mathewson2024-09-301-3/+3
| | | | | | | | | | | | | | Per our policy, every one of these gets a minor bump. Generated with: ``` for crate in $(./maint/list_crates | grep '^\(tor\|arti\)-' ); do cargo set-version --bump minor -p $crate; done ``` (Note the use of `-` at the end end of the grep pattern to prevent matching the `arti` crate.)
* Minor bumps on non-tor/arti cratesNick Mathewson2024-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These crates are not in the tor/arti namespace, but we have given them MSRV bumps: ``` oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error ``` We are counting this as a breaking change. Since all of these crates are at 0.x.x, we have indicated the breaking change with a minor version bump. This commit was generated with the following script: ``` BUMPS=" oneshot-fused-workaround slotmap-careful fslock-guard hashx equix caret fs-mistrust safelog test-temp-dir retry-error " for crate in $BUMPS; do cargo set-version --bump minor -p $crate; done ```
* rpclib: Note a key property of RPC error returns.Nick Mathewson2024-09-262-8/+7
|
* Merge branch 'msrv-1.77-and-rusqlite-update' into 'main'David Goulet2024-09-261-1/+1
|\ | | | | | | | | Upgrade MSRV to 1.77 , and rusqlite to 0.32.1 See merge request tpo/core/arti!2451
| * Upgrade MSRV to 1.77Nick Mathewson2024-09-251-1/+1
| | | | | | | | This will allow us to upgrade to the latest version of rusqlite.
* | Merge branch 'upgrades-20240925' into 'main'Nick Mathewson2024-09-261-1/+1
|\ \ | | | | | | | | | | | | Upgrade dependencies in preparation for next week's releases. See merge request tpo/core/arti!2450
| * | Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-1/+1
| | | | | | | | | | | | | | | | | | 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.
* | | rpclib: read SOCKS _after_ processing.Nick Mathewson2024-09-251-12/+12
| |/ |/| | | | | | | | | | | | | When doing the client handshake, we need to read data _after_ we check for stuff to send, since the client speaks first in the socks protocol. Without this patch, the socks handshake just stalls.
* | Merge branch 'socks_read_zero' into 'main'Nick Mathewson2024-09-252-1/+11
|\ \ | | | | | | | | | | | | | | | | | | socks users: detect closed sockets. (TROVE-2024-011) Closes #1635 See merge request tpo/core/arti!2447
| * | socks users: detect closed sockets.Nick Mathewson2024-09-242-1/+11
| |/ | | | | | | | | | | | | | | | | Without this check, our socks code can enter an infinite loop if a socket is closed at the wrong time. Resolves TROVE-2024-011. Fixes #1635.
* | Merge branch 'rename_singleton_id' into 'main'Jim Newsome2024-09-251-2/+2
|\ \ | | | | | | | | | | | | | | | | | | rpc: Rename SingletonId to SingleIdResponse Closes #1585 See merge request tpo/core/arti!2448
| * | rpc: Rename SingletonId to SingleIdResponseNick Mathewson2024-09-241-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calling it "singleton" might have suggested that it was using the [singleton pattern](https://en.wikipedia.org/wiki/Singleton_pattern), which it isn't. (Renaming done with rust-analyzer and double-checked with `git grep`.) Closes #1585.
* | | Run fixup-features in preparation for upcoming release.Nick Mathewson2024-09-251-1/+1
| |/ |/|
* | rpclib: Use prop351 protocol to open streams.Nick Mathewson2024-09-183-11/+16
|/ | | | | | | | | | | Now that prop351 is what Arti speaks, it's what the rpclib needs to provide. Note one change in particular: the `isolation` string is no longer an optional argument when opening a stream. (With prop351, there is no longer such a thing as an "absent" isolation string, and we don't want to imply that there is a difference between None and "".)
* Bump MSRV from 1.70 to 1.75.Wesley Aptekar-Cassels2024-09-161-1/+1
|
* rpclib: Remove TODO about connect=>stream renaming.Nick Mathewson2024-09-101-4/+0
| | | | | AFIACT, all of this renaming is done. I've grepped for `[Cc]onn` and didn't find any more identifiers that needed to be renamed.
* rpclib: Rename "connect" to "open_stream" as appropriate.Nick Mathewson2024-09-103-21/+21
|
* rpclib: Rename connect.rs to stream.rsNick Mathewson2024-09-102-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.)
* Re-run cbindben for new warnings and status codesNick Mathewson2024-09-092-43/+16
|
* Add TODO for renaming connect.rs to streams.rsNick Mathewson2024-09-091-0/+4
|
* socksproto: Add a const for suggested buffer length.Nick Mathewson2024-09-091-2/+2
| | | | | Ticket #1509 will probably get rid of this constant, but for now we may as well put it in one place.
* rpclib: testing for future-proof proxyinfo formatNick Mathewson2024-09-091-9/+65
| | | | | Here we make sure that we can actually skip over other proxy formats in the future.
* arti/rpclib: Tweak proxy_info format.Nick Mathewson2024-09-091-6/+7
| | | | | | | Renamed address to tcp_address, and made it optional, so that later we can have a unix_path, etc. On deser side, add support for unrecognized listener types.
* arti/rpclib: Lowercase our socks5 listener variant.Nick Mathewson2024-09-091-0/+1
|
* rpclib: New error type for unauthenticated connectionsNick Mathewson2024-09-092-2/+16
| | | | | | This is done so that we can make "not authenticated" a non-internal error, under the theory that someday unauthenticated connections might be exposed.
* rpclib: FFI for opening data streams.Nick Mathewson2024-09-0911-7/+408
| | | | | 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-095-4/+339
| | | | | | Requires #1523. Implements #1524.
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-2/+2
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* Fix typosDimitris Apostolou2024-09-035-5/+5
|
* rpclib: Remove in_mut_ptr_opt, and document why.Nick Mathewson2024-08-273-37/+22
|
* rpclib, ffi: Allow simultaneous calls to `arti_rpc_handle_wait()`Nick Mathewson2024-08-274-13/+25
| | | | | | | | | | | | | | Its underlying function previously took `&mut RpcHandle`, which was an accident waiting to happen. Now it takes `&RpcHandle` and includes a Mutex to prevent multiple threads from waiting for updates on the same request ID at once. As an alternative, we *could* try to update connimpl::Receiver to allow multiple simultaneous listeners on the same request ID. But that would (I think) require a lot more bookkeeping, and thus would be a bit more error-prone. Closes #1532.
* rpclib: Allow ConnectionClosed in arti_socket_closed testNick Mathewson2024-08-211-0/+9
| | | | | | | | | | | | | | This test is supposed to check the case where we launch a bunch of requests but the socket is dropped before we get a response. Different operating systems handle 'drop' a bit differently, and schedule threads differently, so we shouldn't be surprised at slightly different errors here. In particular, OSX is more prone to deliver the close as a proper "close" rather than an EPIPE or such, which previously broke this test. Closes #1510.
* ffi: Rename arti_rpc_status_to_str.Nick Mathewson2024-08-142-2/+2
| | | | | | (This function manipulates an ArtiRpcStatus; and we try to have all of the ffi functions in this library begin with "arti_rpc_".)
* cbindgen: Correctly hide "Utf8CString".Nick Mathewson2024-08-143-9/+10
|
* Merge branch 'ffi_dylib' into 'main'Alexander Færøy2024-08-131-0/+3
|\ | | | | | | | | ffi: Build arti-rpc-client-core as a C dynamic library. See merge request tpo/core/arti!2331
| * ffi: Build client-core as a dynamic library.Nick Mathewson2024-08-061-0/+3
| |
* | ffi: Add support for request handlesNick Mathewson2024-08-126-9/+285
| | | | | | | | | | This API allows the caller to launch a request and then watch for updates on it.
* | ffi: New in_mut_ptr_opt type for receiving *mut T.Nick Mathewson2024-08-121-0/+25
| | | | | | | | | | | | | | | | Previously, we had in_ptr_opt for functions that want to take a nullable `*const T` without consuming it. This is the equivalent for taking a nullable `*mut T` without consuming it.
* | ffi: New out_val_opt type for outptrs to non-pointersNick Mathewson2024-08-123-22/+80
| | | | | | | | | | | | | | | | Previously, we had out_ptr_opt for functions that wanted to return a newly allocated `ArtiRpcFoo` via a `struct ArtiRpcFoo **` argument. But we didn't have a way to return non-allocated `int` via an `int *` argument. This code provides that.
* | Re-run cbindgen; new version has changed whitespace.Nick Mathewson2024-08-121-3/+3
| |
* | Re-run cbindgen to fix CINick Mathewson2024-08-081-4/+0
| | | | | | | | | | | | | | For some reason, we wound up - not with anything missing in the header - but with extra warnings in our expected warnings file. I'm tentatively blaming the git merge algorithm, or perhaps the phase of the moon.
* | Merge branch 'docsrs' into 'main'Jim Newsome2024-08-071-1/+0
|\ \ | | | | | | | | | | | | | | | | | | Don't need to tell docs.rs to enable `docsrs` cfg. It does it automatically as of https://github.com/rust-lang/docs.rs/pull/2390#event-11664409098 While this change isn't in our MSRV yet, we were only using this when building for docs.rs, where we use the latest anyway. See merge request tpo/core/arti!2308
| * | Don't need to tell docs.rs to enable `docsrs` cfgKunal Mehta2024-08-021-1/+0
| | | | | | | | | | | | | | | It now does it automatically, see <https://docs.rs/about/builds#detecting-docsrs>.
* | | Merge branch 'cbindgen-ci' into 'main'David Goulet2024-08-072-0/+33
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Test cbindgen correctness in CI Closes #1502 See merge request tpo/core/arti!2320
| * | | Re-run cbindgen to update our generated header.Nick Mathewson2024-08-072-0/+33
| | | | | | | | | | | | | | | | (This is kind of thing that the CI script should remind us to do.)
* | | | rpclib: Rename ParsedRequest to ParsedRequestFieldsNick Mathewson2024-08-071-11/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This name change should emphasize that the (module-private) `ParsedRequestFields` type is only for parsing, and we aren't supposed to actually construct them for our own requests. With this change, and the others on the branch, there's no longer a risk of trying to serialize a ParsedRequestFields (since it doesn't implement Serialize), or to deserialize a Request (since it doesn't implement Deserialize). Closes #1511.
* | | | rpclib: Use JsonValue to re-encode requests.Nick Mathewson2024-08-074-97/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As with responses, we previously used a strategy that could have failed in the future, if we forgot to add an "unexpected_fields" member to one of our structs. Closes #1512.
* | | | rpclib: Unify error type for ValidatedRequest failure.Nick Mathewson2024-08-074-12/+36
| | | |
* | | | rpclib: Refactor request canonicalizationNick Mathewson2024-08-074-28/+38
| | | | | | | | | | | | | | | | | | | | | | | | This lets us make a couple of types module-private, and prepares the way for using the serde_json::Value trick on requests too.
* | | | rpclib: Ensure that re-encoded responses end with NLNick Mathewson2024-08-071-1/+4
| | | |