summaryrefslogtreecommitdiff
path: root/crates/tor-hsservice/src/replay.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-hsservice: Drop now-unused fslock dependencyIan Jackson2024-02-011-1/+0
| | | | We're just using fslock-guard now.
* tor-hsservice: Use tor_persist::state_dirIan Jackson2024-02-011-5/+5
| | | | | | | | | | | | | | | | | | | | | | | We no longer do replay log locking in IptManager::new. Instead, we rely on the acquire_instance call in OnionService::launch, which ends up with ipt_mgr getting an InstanceHandle (which contains a lock guard). OnionServiceStateMgr is abolished; it existed to deal with the generics in the tor_persist::StateMgr API. state_dir has no generics (other than the T being loaded/stored). Many places (structs and argument lists) now have state_dir types which embody a path (or a CheckeDir) along with a lock, rather than separate path+lock+mistrust. The creation/startup code uses the new calls from state_dir. Other more minor changes: - StartupError::StateDirectoryInaccessible contains tor_persist::Error - test::create_storage_handles_from_state_dir changed and renamed, from _from_state_mgr. - replay::PersistFile's (separate) file lock is now fslock_guard's
* test-temp-dir: New crateIan Jackson2024-01-251-2/+1
| | | | | Introduce the crate, move the code motion, and make minimal necessary changes.
* tor-hsservice: replay: partial write test - commentaryIan Jackson2024-01-251-0/+29
|
* tor-hsservice: replay: partial write testIan Jackson2024-01-251-2/+114
|
* tor-hsservice: replay: partial write test, skeletonIan Jackson2024-01-251-0/+40
|
* test_temp_dir: Split up .used_byIan Jackson2024-01-251-2/+2
| | | | | | | | | | This method combined two things: 1. the lifetime guard API 2. creation of a subdirectory. 2 is available in raw form too, but not 1. So rename the combined method to .subdir_used_by and implement it in terms of a new .used_by which doesn't make a subdirectory.
* tor-hsservice: Recover from partial writesIan Jackson2024-01-251-2/+29
| | | | Fixes #1207.
* tor-hsservice: replay: Introduce an EH IEFE (fmt)Ian Jackson2024-01-251-2/+1
|
* tor-hsservice: replay: Introduce an EH IEFEIan Jackson2024-01-251-7/+11
| | | | | We're going to want to do more things here, all of which want the same error handling.
* tor-hsservice: replay: Combine PersistFileIan Jackson2024-01-251-16/+25
| | | | | This combines two logically-parallel options. Also, it provides us a place to put another piece of information we want in a moment.
* tor-hsservice: replay: Break out truncate_to_multipleIan Jackson2024-01-251-8/+13
|
* tor-hsservice: replay: Break up a paragraphIan Jackson2024-01-251-1/+3
|
* tor-hsservice: todos: Remove blanket allowIan Jackson2024-01-111-2/+0
| | | | We now have more fine-grained allows.
* tor-hsservice: todos: reference a new ticket about flushingIan Jackson2024-01-111-0/+1
| | | | | Deciding what to do about this *is* a MUST, but maybe we'll downgrade that ticket.
* tor-hsservice: todos: reference a new ticket about the partial write bugIan Jackson2024-01-111-1/+1
| | | | This *is* a MUST.
* tor-hsservice: todos: reference the ephemeral services ticketIan Jackson2024-01-111-0/+1
| | | | This isn't a MUST.
* Fix typosDimitris Apostolou2024-01-081-1/+1
|
* tor-hsservice: replay: Note a bugIan Jackson2023-12-131-0/+4
|
* tor-hsservice tests: replay: Provide for a filesystem lockfileIan Jackson2023-12-131-2/+22
| | | | | This is to prevent current use of the same directory of replay logs by different instances.
* tor-hsservice tests: replay: Break out create_loggedIan Jackson2023-12-131-13/+25
|
* tor-hsservice: ReplayLog: Fix file magicIan Jackson2023-12-131-1/+1
| | | | | | | | | | This ought to have the hash algorithm name in it or we'll have trouble if we want to change the hash algorithm in the future. (Strictly, we could just choose a different magic but the string was rather short.) Add a newline, which is often convenient in file headers. And "onion" to mean "onion swervice" is improper.
* tor-hsservice: ReplayLog: Slight tidying upIan Jackson2023-12-131-3/+5
| | | | Make `#[cfg(target_family = "unix")]` appear only once.
* replay: Remove false-positive special-casing in testsNick Mathewson2023-11-021-31/+10
| | | | | | (The actual false positive rate for these cases is very small, since the filters are very much not full. I haven't been able to hit one in hours of looping.)
* Add a missing backtick.gabi-2502023-11-021-1/+1
|
* Use io::Result to shorten return type.gabi-2502023-11-021-1/+1
|
* hss: Add functionality for a persistent replay log.Nick Mathewson2023-11-021-0/+421
See comments for design notes.