Commit Graph

126 Commits

Author SHA1 Message Date
Nick Mathewson f55950ab8d Fix a few typos.
Also fix some commonwealth spellings that had slipped in.
2021-11-24 18:12:44 -05:00
Nick Mathewson 727e420d5c Remove unused "dirs" dependency from tor-persist. 2021-11-16 15:51:35 -05:00
Nick Mathewson a940679672 Document that the "testing" feature is not semver-covered. 2021-11-11 10:38:23 -05:00
Nick Mathewson 619ae65064 Change how TestingStateMgr handles locking.
Previously it was either all-locked or all-not-locked.  Now you can
simulate having the same shared storage opened by multiple managers,
only one of which has the lock.
2021-11-03 13:27:01 -04:00
Nick Mathewson f5d042115a tor-persist: serde usage now requires derive feature. 2021-10-29 11:41:26 -04:00
Nick Mathewson e6e740646a Bump all crate versions to 0.0.1 2021-10-29 11:05:51 -04:00
Nick Mathewson 2fae63b5ae Upgrade to fslock version 0.2
This version makes all locks per-handle rather than per-process, by
moving from lockf() to flock() on unix.
2021-10-27 14:52:09 -04:00
eta 5a4db67b16 Add Futureproof<T> wrapper type, use for GuardDisabled enum
The Futureproof<T> type lets you serialize and deserialize types whose
representations might change (most useful for enums that might grow
additional variants). It uses #[serde(untagged)] to accomplish this.

This gets used in order to make the `disabled` field of `Guard` more
robust against future guard disablement reasons being added.

A test was also added to verify correct behaviour of the new type.
2021-10-27 15:10:44 +01:00
eta 7a931b4de3 Add #[serde(flatten)] HashMap fields to serializable objects
As per arti#175, we'd like to be able to handle newer Arti versions
storing additional state in the persisted state files, without dropping
this data on the floor when we write out changes to these files.

Use the #[serde(flatten)] mechanism to achieve this, by adding catch-all
HashMap<String, JsonValue> fields to all structs that are at risk of
this happening to them.
2021-10-27 13:31:52 +01:00
Nick Mathewson fe85f44fd0 Remove try_lock from StorageHandle. 2021-10-20 09:42:34 -04:00
Nick Mathewson 7b6ed9dab6 Replace the return type of StorageMgr::try_lock with a tristate
It's useful to know now only if we now have the lock, but also if we
just got it for the first time.
2021-10-20 09:37:53 -04:00
Nick Mathewson c41dd01a14 Add a GuardMgr member to CircuitBuilder 2021-10-10 12:24:48 -04:00
Nick Mathewson af7c9d5a0b enable checked_conversions lint. 2021-10-09 16:53:13 -04:00
Nick Mathewson 4a7c563b79 Fix some typos (via the "typos" tool) 2021-10-08 09:42:54 -04:00
Nick Mathewson 7e68883a27 Change tor-persist to use json instead of toml.
The limitations with toml seemed to be reaching a head, and I wasn't
able to refactor the guardmgr code enough to actually have its state
be serializable as toml.  Json's limitations are much narrower.
2021-10-07 09:30:08 -04:00
Jani Monoses f7e114c833 Allow building tor-persist for WASM 2021-10-01 14:22:31 +03:00
Nick Mathewson 83b03a20a3 Clarify why we use a dyn pointer for StorageHandle. 2021-09-30 15:36:11 -04:00
Nick Mathewson 37bec4997d remote unused tor-persist/src/config.rs 2021-09-30 15:36:11 -04:00
Nick Mathewson 37040d06d1 Add tests for tor-persist object-safe wrapper. 2021-09-30 15:36:11 -04:00
Nick Mathewson fa9e64e27b tor-persist: Add a testing-only state manager that doesn't use disk 2021-09-30 15:36:11 -04:00
Nick Mathewson eef06efea6 Move FsStatemgr to an inner module. 2021-09-30 15:36:11 -04:00
Nick Mathewson f3d29b5006 Add an object-safe wrapper for StateMgr.
This is an attempt to uplift the trick that tor-circgmr is currently
using, since we'll want it in tor-guardmgr too.
2021-09-30 15:36:11 -04:00
Trinity Pointard 954395573a update fslock to compile android 2021-09-25 12:01:45 +02:00
Nick Mathewson b51e2ff5b3 Upgrade memmap2, directories, and dirs dependencies. 2021-09-23 08:26:29 -04:00
Daniel Eades fb3b8b84b5 fix/silence clippy lints in test modules 2021-09-08 17:28:31 +02:00
Nick Mathewson 557a0ff40b Move all crates into a `crates` subdirectory.
This will cause some pain for now, but now is really the best time
to do this kind of thing.
2021-08-27 09:53:09 -04:00