aboutsummaryrefslogtreecommitdiff
path: root/src/or
AgeCommit message (Collapse)Author
2017-05-02Break connection_dir_client_reached_eof() into smaller functionsNick Mathewson
This was a >630-line function, which doesn't make anybody happy. It was also mostly composed of a bunch of if-statements that handled different directory responses differently depending on the original purpose of the directory connection. The logical refactoring here is to move the body of each switch statement into a separate handler function, and to invoke those functions from a separate switch statement. This commit leaves whitespace mostly untouched, for ease of review. I'll reindent in the next commit.
2017-05-02Remove special-casing for NO_METHOD in consdiffmgr.cNick Mathewson
2017-05-01Merge branch 'dgoulet_bug22042_031_01_squashed'Nick Mathewson
2017-05-01control: Fix comment of control_event_hs_descriptor_contentDavid Goulet
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-05-01hs: Trigger control event when client can't pick HSDirDavid Goulet
Inform the control port with an HS_DESC failed event when the client is unable to pick an HSDir. It's followed by an empty HS_DESC_CONTENT event. In order to achieve that, some control port code had to be modified to accept a NULL HSDir identity digest. This commit also adds a trigger of a failed event when we are unable to base64-decode the descriptor cookie. Fixes #22042 Signed-off-by: David Goulet <dgoulet@torproject.org>
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-27Pass incoming consensus documents to the consdiffmgr codeNick Mathewson
2017-04-27Clean the consdiffmgr cache and launch new diffs as needed.Nick Mathewson
2017-04-27Initialize consdiffmgr when running as (or becoming) a server.Nick Mathewson
2017-04-27Use a cast to try to avoid a tautalogical comparison warningNick Mathewson
2017-04-27Merge branch 'parse_accept_encoding'Nick Mathewson
2017-04-27Move the "supported compression bitmask" into compress.[ch]Nick Mathewson
2017-04-27Merge branch 'dirreq'Nick Mathewson
2017-04-27Improve control flow in authority_certs_fetch_resource_implNick Mathewson
2017-04-27Include UPLOAD_RENDDESC_V2 in PURPOSE_IS_UPLOADNick Mathewson
This was only used in one place before, and it's safe to update it.
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-25Bitmask out the compression methods that we do not supportNick Mathewson
2017-04-25Tests for parse_accept_encodingNick Mathewson
2017-04-25Parse recognized entries from the Accept-Encoding header.Nick Mathewson
2017-04-25Teach consdiffmgr to remember two digests: one compressed, one not.Nick Mathewson
2017-04-25Teach cov-exclude to detect runaway LCOV_EXCL_START linesNick Mathewson
Also, fix two instances of runaway LCOV_EXCL_START lines.
2017-04-25Merge branch 'atomic_counters'Nick Mathewson
2017-04-25Merge remote-tracking branch 'dgoulet/bug21293_031_01'Nick Mathewson
2017-04-25trace: Add a basic event-tracing infrastructure.David Goulet
This commit adds the src/trace directory containing the basics for our tracing subsystem. It is not used in the code base. The "src/trace/debug.h" file contains an example on how we can map our tor trace events to log_debug(). The tracing subsystem can only be enabled by tracing framework at compile time. This commit introduces the "--enable-tracing-debug" option that will make all "tor_trace()" function be maped to "log_debug()". Closes #13802 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-25Use atomic counters for compressor allocation.Nick Mathewson
2017-04-25relay: Change LD_BUG log to LD_PROTOCOL_WARNDavid Goulet
That log statement can be triggered if somebody on the Internet behaves badly which is possible with buggy implementation for instance. Fixes #21293 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-04-25Merge branch 'ahf_prop278_21662_squashed'Nick Mathewson
2017-04-25Use `tor_compress_supports_method()` before printing library versions.Alexander Færøy
This patch ensures that Tor checks if a given compression method is supported before printing the version string when calling `tor --library-versions`. Additionally, we use the `tor_compress_supports_method()` to check if a given version is supported for Tor's start-up version string, but here we print "N/A" if a given compression method is unavailable. See: https://bugs.torproject.org/21662
2017-04-25Add `tor_compress_get_total_allocation()` function.Alexander Færøy
This patch adds the `tor_compress_get_total_allocation()` which returns an approximate number of bytes currently in use by all the different compression backends. See: https://bugs.torproject.org/21662
2017-04-25Display LZMA and Zstandard versions when starting Tor.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Show liblzma and libzstd versions in `tor --library-versions`.Alexander Færøy
See: https://bugs.torproject.org/21662
2017-04-25Add --enable-zstd to our configure script.Alexander Færøy
This patch adds support for enabling support for Zstandard to our configure script. By default, the --enable-zstd option is set to "auto" which means if libzstd is available we'll build Tor with Zstandard support. See: https://bugs.torproject.org/21662
2017-04-25Add --enable-lzma to our configure script.Alexander Færøy
This patch adds support for enabling support for LZMA to our configure script. By default, the --enable-lzma option is set to "auto" which means if liblzma is available we'll build Tor with LZMA support. See: https://bugs.torproject.org/21662
2017-04-25Rename the `torgzip` module to `compress`.Alexander Færøy
See https://bugs.torproject.org/21663
2017-04-25Move zlib compression code into its own module.Alexander Færøy
This patch refactors the `torgzip` module to allow us to extend a common compression API to support multiple compression backends. Additionally we move the gzip/zlib code into its own module under the name `compress_zlib`. See https://bugs.torproject.org/21664
2017-04-24Merge remote-tracking branch 'dgoulet/ticket21980_031_01'Nick Mathewson
2017-04-24Fix a signed/unsigned comparison warning on 32-bitNick Mathewson
2017-04-24Merge branch 'consdiffmgr_squashed'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