aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-dirmgr
Commit message (Collapse)AuthorAgeFilesLines
...
* | bridge desc: todo re config: weaken and reference a new ticketIan Jackson2022-11-081-3/+2
|/
* Merge branch 'store' into 'main'Nick Mathewson2022-11-085-41/+466
|\ | | | | | | | | | | | | Persistently cache bridge descriptors Closes #619 See merge request tpo/core/arti!831
| * bridge descs: Rename BridgeDescMgr from BridgeDescManagerIan Jackson2022-11-082-15/+15
| | | | | | | | | | | | This is more consistent with our naming elsewhere. Suggested-by: Nick Mathewson <[email protected]>
| * bridge descs: Apply sensitive() to bridge identity in error log msgIan Jackson2022-11-082-1/+3
| |
| * sqlite cache: Document reasoning about timestampsIan Jackson2022-11-081-2/+9
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/831#note_2851764
| * bridge desc tests: Test caching and if-modified-sinceIan Jackson2022-11-041-2/+121
| |
| * bridge desc tests: Break out queues_are_empty helperIan Jackson2022-11-041-2/+6
| |
| * bridge desc tests: Provide a sqlite connectionIan Jackson2022-11-041-2/+5
| | | | | | | | The current test case doesn't use this.
| * bridge desc: Implement storage functions at the DB layerIan Jackson2022-11-041-8/+67
| |
| * bridge desc: Make Downloaded be DebugIan Jackson2022-11-041-0/+1
| |
| * bridge desc: Implement cache reuse logic and if-modified-sinceIan Jackson2022-11-044-9/+196
| | | | | | | | | | | | | | | | | | | | | | | | This introduces the new API functions to Store. But currently they are all no-ops. So all this machinery doesn't actually do anything. Also, it changes the API to the mockable downloader, to allow it to support if-modified-since. So this isn't used either. But it is more convenient to do this all at once in BridgeDescManager, since care needs to be taken about the intraction between if-modified-since and the persistent cache.
| * bridge desc: Rename one more variable to textIan Jackson2022-11-041-1/+1
| |
| * bridge desc: Catch panics in the download functionalityIan Jackson2022-11-041-1/+8
| |
| * bridge desc: Provide a Store to the bridge desc managerIan Jackson2022-11-043-16/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We use the one in the dirmgr. That means that our constructor now has to take a dirmgr. And, the dirmgr must have a circmgr. This is all rather odd, TBH. Add .. to the binding of the return values from setup, as future-proofing. The tests now need to provide a Store too. Make the sqlite::new_empty function pub(crate) so we can use it. We must retain the _db_tmp_dir, since when it goes away the tmp directory is deleted and the db goes readonly.
| * bridge desc tests: Apply tracing_test::traced_testIan Jackson2022-11-042-0/+3
| | | | | | | | This lets us see the log messages. They look fine, as it happens.
* | Merge branch 'store-yak-misc' into 'main'eta2022-11-083-11/+34
|\| | | | | | | | | Small misc yaks for bridge descriptor persistence See merge request tpo/core/arti!828
| * tor-dirmgr: impl AsRef<dyn Error> for ErrorIan Jackson2022-11-041-0/+7
| | | | | | | | This allows use with tor_error::Report.
| * dirmgr: Make store be in an ArcIan Jackson2022-11-041-2/+2
| | | | | | | | | | This will let us share it with the bridge descriptor manager. (As discussed with Nick.)
| * dirmgr sqlite store: Improve schema updatesIan Jackson2022-11-041-9/+25
| | | | | | | | | | | | | | | | | | * Centralise applying the schema updates, in a closure * Make the schema update SQL texts be in an array so we can loop * Make the version update statement generic, not cloned-and-hacked This will make it possible to add another schema version without error-prone conditions etc.
* | Fix typosDimitris Apostolou2022-11-061-1/+1
|/
* bridgedesc: Rename "text" from "output"Ian Jackson2022-11-031-5/+5
| | | | | | This was confusing, because it's the output of the donwload, but nowhere near the output of the whole process. And it's going to become even less so.
* bridgedesc: Make process_document into a free functionIan Jackson2022-11-031-53/+67
| | | | It deserves this treatment, I think.
* bridgedesc: Introduce DownloadedIan Jackson2022-11-031-13/+17
| | | | | This gives names to things and makes things clearer, and this will be even more true in a moemnt.
* bridgedesc: download: Break out process_documentIan Jackson2022-11-031-47/+54
| | | | We're going to want to reuse this for handling cached stuff.
* bridgedesc: Prepare Mockable trait for if-modified-sinceIan Jackson2022-11-032-6/+15
|
* Run add_warnings.Nick Mathewson2022-11-031-0/+1
|
* bridge descriptors tests: Fix flaky testIan Jackson2022-11-031-1/+11
|
* bridge descriptors tests: Test set_bridges more thoroughly (fix)Ian Jackson2022-11-031-1/+1
| | | | | | The RetryDelays are being triggered for the 2nd time here, so their timeouts can be longer. We must bump the sleep to make sure we don't have a flaky test.
* bridge descriptors: logging: Log addition and removal (fmt)Ian Jackson2022-11-031-12/+20
| | | | Worsify formatting as demanded by rustfmt.
* bridge descriptors: logging: Log addition and removalIan Jackson2022-11-031-8/+31
| | | | | This involves breaking the calls to `new_bridges.remove` into a helper that does the logging.
* bridge descriptors: logging: Log download start and outcomeIan Jackson2022-11-031-0/+6
|
* bridge descriptors tests: Test set_bridges more thoroughlyIan Jackson2022-11-031-0/+34
| | | | | | | | Prior to the previous commit, set_bridges would malfunction if there were bridges which where (i) in current (ii) in queued or running (iii) in the new bridge set. This test failed then and passes now.
* bridge descriptors: Rewrite set_bridgesIan Jackson2022-11-031-18/+12
| | | | | | | | This was fundamentally confused and irregular. Now it is more regular: it does the same things to all the elements of Tracked, and a simple filtering on current. This fixes a bug, for which I'm about to add a test case.
* bridge descriptors tests: Add another couple of test casesIan Jackson2022-11-031-1/+31
|
* bridge descriptors tests: stream_drain_ready returns event countIan Jackson2022-11-031-1/+4
| | | | We'll use this in a moment.
* bridge descriptors tests: Break out bad_bridge helper functionIan Jackson2022-11-031-7/+7
|
* bridge descriptors: Change default max_refetchIan Jackson2022-11-032-2/+2
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/820#note_2850269
* bridge descriptors: Add clarification about bridge statesIan Jackson2022-11-031-0/+3
|
* bridge descriptors: Improve and fix docs for consider_launchingIan Jackson2022-11-031-1/+6
|
* bridge descriptors: Add comments where StateGuard is droppedIan Jackson2022-11-031-0/+8
|
* bridge descriptors: Document `changed` and `earliest_timeout` OptionsIan Jackson2022-11-031-0/+5
|
* bridge descriptors: Document updates argument to timeout_taskIan Jackson2022-11-031-0/+6
|
* Require derive_more 0.99.3Ian Jackson2022-11-031-1/+1
| | | | | | | | 0.99.[012] have a bug https://github.com/JelteF/derive_more/issues/114 which makes the Deref derive for bridgedesc::StateGuard not work and therefore breaks minimal-versions CI. It seems simpler to require the newer version everywhere.
* bridge descriptors: TestsIan Jackson2022-11-033-0/+270
|
* bridge descriptors: Provide a consistency check functionIan Jackson2022-11-031-0/+196
| | | | | This is really part of the tests, but I put it here so that it can be compiled-in if someone wants it during debugging.
* bridge descriptors: Provide an implementation of BridgeDescProviderIan Jackson2022-11-033-0/+1098
| | | | Tests will come in a moment.
* Copy tor-netdoc/testdata/routerdesc1.txt into tor-dirmgrIan Jackson2022-11-031-0/+50
| | | | | This seems better than having tor_netdoc export a `#[cfg(test)]` public constant.
* remove unused dependanciestrinity-1686a2022-10-291-1/+0
|
* tor-dirmgr: impl Default for FlagPublisherIan Jackson2022-10-271-0/+6
|
* tor-dirmgr: impl FlagEvent for BridgeDescEventIan Jackson2022-10-271-0/+6
|