summaryrefslogtreecommitdiff
path: root/src/or/consdiffmgr.c
AgeCommit message (Collapse)Author
2018-01-31But in most Earth cultures, there are 60s in a minute.Nick Mathewson
2018-01-31add a rate-limit.Nick Mathewson
2018-01-26If out-of-disk when saving a consensus cache entry, don't BUG.Nick Mathewson
Just warn instead. Fixes bug 24859.
2017-11-20Add another assertion to check for 24086 root causesNick Mathewson
In cdm_diff_ht_set_status(), we shouldn't have been allowing the status CDM_DIFF_PRESENT to be set if there wasn't actually a handle.
2017-11-20Correctly handle partial success in consensus diff calculation.Nick Mathewson
Previously, if store_multiple() reported a partial success, we would store all the handles it gave us as if they had succeeded. But it's possible for the diff to be only partially successful -- for example, if LZMA failed but the other compressors succeeded. Fixes bug 24086; bugfix on 0.3.1.1-alpha.
2017-08-29On windows, allow many entries in conscache directoriesNick Mathewson
Since we can't be sure that we can unlink enough files on windows here, let's let the number of permitted entries grow huge if it really must. We do this by letting the storagedir hold lots of entries, but still trying to keep the number of entries under the configured limit. We also have to tell consdiffmgr not to freak out if it can't actually remove enough entries. Part of a fix for bug 22752
2017-08-08Fix a memory leak in consdiffmgr.cNick Mathewson
Fixes bug 23139; bugfix on 0.3.1.1-alpha.
2017-07-27Merge branch 'multi-priority_squashed' into maint-0.3.1Nick Mathewson
2017-07-27Queue consensus diffs at LOW priority.Nick Mathewson
Fixes bug 22883.
2017-07-12New configuration option MaxConsensusAgeForDiffsNick Mathewson
Relay operators (especially bridge operators) can use this to lower or raise the number of consensuses that they're willing to hold for diff generation purposes. This enables a workaround for bug 22883.
2017-06-28Replace crash on missing handle in consdiffmgr with nonfatal assertNick Mathewson
Attempts to mitigate 22752.
2017-06-27Set published_out for consensus cache entries in ↵Alexander Færøy
spooled_resource_estimate_size(). This patch ensures that the published_out output parameter is set to the current consensus cache entry's "valid after" field. See: https://bugs.torproject.org/22702
2017-05-16Fix resource leak in parse_consensus_request()Nick Mathewson
We were allocating diff_hash_in_url on some URLs, but not freeing it. Fixes CID 1409669. Bug not in any released Tor.
2017-05-16Report deleted consensuses as NOT_FOUND rather than AVAILABLENick Mathewson
This bug happened because of a bogus pointer check in consdiffmgr_find_consensus(), not in any released Tor. Fixes CID 1409670. Good catch, Coverity!
2017-05-15fix a memory leakNick Mathewson
2017-05-15Merge remote-tracking branch 'public/prop140_aftermath_cfg'Nick Mathewson
2017-05-15Copy valid/fresh-until and signatories values into diffs.Nick Mathewson
2017-05-15Store fresh/valid-until and signatories values on all consensus objects.Nick Mathewson
2017-05-15Implement functions to expose valid/fresh-until and votersNick Mathewson
These still won't do anything till I get the values to be filled in. Also, I changed the API a little (with corresponding changes in directory.c) to match things that it's easier to store.
2017-05-15Move stub accessor functions a level higher, to consdiffmgrNick Mathewson
2017-05-12Fix tautological constant out-of-range comparison warnings.Alexander Færøy
2017-05-12Fix DoubleNL warning from `make check-spaces`.Alexander Færøy
2017-05-12Test fix: expect old consensuses to be deleted if not deflate-compressedNick Mathewson
2017-05-12consdiffmgr: Reload latest consensus entries on start.Nick Mathewson
2017-05-12consdiffmgr: expose cached consensusesNick Mathewson
2017-05-12Cleanup logic: only retain zlib-compressed consensusesNick Mathewson
Now that we're making a bunch of these with consdiffmgr, we should throw out all but one when we get a newer consensus.
2017-05-12consdiffmgr: compress incoming consensuses in the backgroundNick Mathewson
Also, compress them in several ways. This breaks the unit tests; subsequent commits will make them pass again.
2017-05-12consdiffmgr: Extract the code for compressing and storingNick Mathewson
We're going to use this for consensuses too.
2017-05-05Turn consdiffmgr.cache_max_age_hours into a parameterNick Mathewson
2017-05-04Do not BUG on missing sha3-as-signed fieldNick Mathewson
This can happen if you've been running an earlier alpha on your relay. Instead, just ignore the entry.
2017-05-04bug#22143/prop#140: in consdiffmgr, store and use digest-as-signedNick Mathewson
We need to index diffs by the digest-as-signed of their source consensus, so that we can find them even from consensuses whose signatures are encoded differently.
2017-05-02Remove special-casing for NO_METHOD in consdiffmgr.cNick Mathewson
2017-04-28Fix a brazen memleak in consdiffmgr_add_consensus()Nick Mathewson
2017-04-27Merge branches 'consdiffmgr_orig_squashed' and 'actually_compute_diffs_squashed'Nick Mathewson
2017-04-27Pre-compress consensus diffs with supported consensus methods.Nick Mathewson
2017-04-27Store archived consensuses compressed on disk.Nick Mathewson
I'm just using gzip compression now, for performance.
2017-04-27Functionality to ensure there is space to add files to cache.Nick Mathewson
2017-04-27New force-delete option on consensus_cache_delete_pending()Nick Mathewson
If we're out of file space in the storage directory, we'll need to get rid of old files fast.
2017-04-27Lower the file limit in consdiffmgr, to support seccomp2Nick Mathewson
2017-04-27Initialize consdiffmgr when running as (or becoming) a server.Nick Mathewson
2017-04-26Fix coverity cid 1405510Sebastian Hahn
This is a false positive, but let's appease coverity.
2017-04-25Configure sandbox using consdiffmgr; free cdm on exit.Nick Mathewson
2017-04-25Teach consdiffmgr to remember two digests: one compressed, one not.Nick Mathewson
2017-04-24consdiffmgr: add tests for cdm_entry_get_sha3_valueNick Mathewson
2017-04-24Fix reference leak & handle leak in consensus_diff_worker_replyfnNick Mathewson
Found by previous test.
2017-04-24Add a hashtable to consdiffmgr to keep track of diff statusNick Mathewson
In several places in the old code, we had problems that only an in-memory index of diff status could solve, including: * Remembering which diffs were in-progress, so that we didn't re-launch them. * Remembering which diffs had failed, so that we didn't try to recompute them over and over. * Having a fast way to look up the diff from a given consensus to the latest consensus of a given flavor. This patch adds a hashtable mapping from (flavor, source diff), to solve the problem. It maps to a cache entry handle, rather than to a cache entry directly, so that it doesn't affect the reference counts of the cache entries, and so that we don't otherwise need to worry about lifetime management.
2017-04-24Consdiffmgr: extract "get a sha3 digest" function.Nick Mathewson
I'll be using this a lot in the hashtable tweaks here.
2017-04-24consdiffmgr: function to re-validate stored sha3 digests at startupNick Mathewson
2017-04-24Consdiffmgr: use aggressive-release flag on consensusesNick Mathewson
This conscache flag tells conscache that it should munmap the document as soon as reasonably possible, since its usage pattern is expected to not have a lot of time-locality.
2017-04-24Test the easiest cases of consdiffmgr_cleanup.Nick Mathewson
One more to go: deleting the old diffs.