The function is made safe and now returns Result. Functionally it now
fails when it can not write the newly generated key to the database
whereas before it still returned the key but logged a warning. There
is no reason this shouldn't be able to store the key and silently not
storing the key may result in later operations assuming the key is
available, so failing seems like a better choice.
The function now also uses a proper mutex to guard against multiple
threads generating keys. And this mutex is Context-scoped rather than
fully global (static).
- better README reflecting how to use things, don't advertise
run-integration-tests to only have one documented way
and use less tools for rust-devs that just want to run
python tests
- fix test skipping and get circle-ci to play along
- update docker related docs as well
This removes the dc_context_unref function from the Rust API which was
just an alias for dc_close. It still exists on the C API where it
makes sure to free the memory.
It also implements Drop for the context which just calls dc_close to
make sure all the memory is freed. Since you can call dc_close as
many times as you like this ensures that at the Rust level you can't
Drop the struct without releasing the memory.
Finally since memory is now freed by dropping the struct this removes
the #[repr(C)] for the struct. This struct is fully opaque to the C
API.
This marks the function safe and returns Result, it also now returns
the ConfiguredAddr since it has to look this up anyway and it makes
testing more easy. Turns out it reduces some duplicate SQL query in
some callers too.
More test code has been moved from dc_imex to test_utils as it's
more genrally applicable.
Add a test for failing e2e encryption and some info statement to hunt where the e2e encryption failure comes from, as well as fix the issue.
Closes#233