aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-persist/src/fs.rs
Commit message (Collapse)AuthorAgeFilesLines
* arti-client: Unlock the state manager on failure to bootstrapeta2022-02-241-0/+11
| | | | | | | | | | | | `StateMgr` got a new `unlock()` method that does what it says on the tin. We now call it from `bootstrap()` using the new `util::StateMgrUnlockGuard`, which works in a manner similar to the `BoolResetter` from `tor_dirmgr`. (A decent small little task in future might be to unify these types in some sort of general arti utility crate?) closes arti#335
* tor-persist: Distinguish load vs. store json errorsIan Jackson2022-02-041-2/+3
| | | | | | | | Serialisation errors ought not to occur, since they would represent an attempt to store malformed data, or something. (We always convert to a string, so the JSON error never contains IO errors or the like.) Deserialisation errors mean the persistent state is corrupt.
* clippy: Pass simply &output to fs::writeIan Jackson2022-02-021-1/+1
| | | | | | clippy::needless_borrow quibbles here, IMO correctly. Its suggestion didn't go far enough: output is a String and a &String can be passed to write as-is for identical effect.
* Fix Rustdoc errors.Nick Mathewson2021-12-081-1/+1
|
* Test FsStateMgr::path(), and fix a bug in it.Nick Mathewson2021-12-071-1/+8
| | | | | We join "state" to the directory name, so we must call parent() to get the original.
* Sketch API for reconfiguration.Nick Mathewson2021-12-071-0/+4
| | | | | | | This patch doesn't actually make anything reconfigurable, but it does create an API that will tell you "you can't change the value of that!" If the API looks reasonable, I can start making it possible to change the values of individual items.
* Upgrade to fslock version 0.2Nick Mathewson2021-10-271-1/+1
| | | | | This version makes all locks per-handle rather than per-process, by moving from lockf() to flock() on unix.
* Replace the return type of StorageMgr::try_lock with a tristateNick Mathewson2021-10-201-6/+8
| | | | | It's useful to know now only if we now have the lock, but also if we just got it for the first time.
* Change tor-persist to use json instead of toml.Nick Mathewson2021-10-071-9/+8
| | | | | | 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.
* Move FsStatemgr to an inner module.Nick Mathewson2021-09-301-0/+191