| Commit message (Collapse) | Author | Age | Files | Lines |
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
|
| |
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.
|
| |
|
|
| |
Closes #1588.
|
| |
|
|
|
|
|
|
|
|
| |
The two main causes of errors were:
- Since some of the lifetime rules have changed, we no longer need
to do as many "bind a variable and immediately return it"
patterns, and so clippy now warns about them.
- We needed to adjust the explicit captures (`use<...>`)
in a couple of our RPIT instances.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Change `..UnixAddress...` to `...AfUnixAddress..`.
|
| |
|
|
|
| |
This variant breaches the new guidelines about AF_UNIX terminology.
And its purpose is unclear and it's not used.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Closes #1650.
|
| |
|
|
|
| |
This type explains where every error came from, and explains why
each declined connect point was declined.
|
| |
|
|
|
|
|
|
| |
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".
|
| |
|
|
|
|
|
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
Closes #1753
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Expose ArtiRpcConnBuilder and appropriate C wrapper functions in
our FFI code, and wrap those functions in our python wrapper.
This breaks the old C API, but that's allowed since the API
is still experimental.
Some design decisions:
* I've wrapped the builder in a Mutex, so that we can continue
our FFI rule that we do not require non-Rust code to wrap `&mut`.
* I've removed the non-builder connect() function from the C API
as extraneous.
* I've made a single function to prepend elements to the search
path.
|
| | |
|
| |
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
These are new in Rust 1.83.
|
| |
|
|
|
| |
Previously we implied that it was only for strings,
which isn't the case.
|
| | |
|
| |
|
|
|
| |
Arti has a MSRV of rust 1.77 which supports C string literals, so
'c_str_macro' isn't needed.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
This is done so that we can make "not authenticated" a non-internal
error, under the theory that someday unauthenticated connections
might be exposed.
|
| |
|
|
|
| |
There's a blocking TODO here about exposing socks error codes that
I still need to solve.
|
| |
|
|
|
|
| |
Requires #1523.
Implements #1524.
|
| | |
|
| |
|
|
|
|
| |
(This function manipulates an ArtiRpcStatus;
and we try to have all of the ffi functions in this library
begin with "arti_rpc_".)
|
| |
|
|
|
|
|
|
| |
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.
|
| |\
| |
| |
| |
| | |
Fix a pair of typos in an ffi comment.
See merge request tpo/core/arti!2310
|
| | | |
|
| | |
| |
| |
| | |
Closes #1501.
|
| |/
|
|
| |
(This is an errno or a GetLastError.)
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|
|
|
|
|
| |
Additionally, inline the related conversion functions.
This should reduce the total amount of unsafe code that somebody
would need to look at.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These macros do the only part of our FFI functions that needs to be
`unsafe`: converting input pointers into types that can be used in
safe rust. I've added documentation about what requirements each of
these conversions puts onto out inputs: both informally, and via a
reference to the relevant parts of the Rust library documentation.
While doing this I found a safety bug in `OutPtr::from_opt_ptr`:
it should have been using `MaybeUninit`.
These macros should allow us to build a "proof sketch" for the
safety of our FFI code. We need to show, for each input parameter:
- That the documented requirements for its conversion method
are also documented requirements for that kind of input, in our
header file.
- That the documented requirements for how it can be used
after conversion are in fact followed in the code.
|
| | |
|
| |
|
|
| |
In brief: Everything now starts with ARTI_RPC, arti_rpc, or ArtiRpc.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These documents are no longer called "safety". They are now mostly
collected as a big list of "correctness requirements" at the start
of the cbindgen header. Because of these requirements, most
functions no longer need their own "safety" sections.
I am explicitly using `#[allow(clippy::missing_safety_doc)]` on each
function, rather than adding a blanket exception:
- There are other unsafe functions in this code, to which we
wouldn't want an exception to apply.
- Documenting the safety^W correctness requirements of a function
is important enough to make sure that we aren't skipping out on
it unintentionally.
|
| | |
|
| |
|
|
|
|
|
|
| |
Per discussion, we'd rather have an optional output parameter for error
objects rather than mess with thread-local variables.
This is possibly less convenient for direct usage from C,
but likely more convenient for wrapper functions in other languages.
|
| | |
|
| | |
|