summaryrefslogtreecommitdiff
path: root/src/or/directory.c
AgeCommit message (Collapse)Author
2017-11-17Intoduce unittest for skipping outdated dirservers.George Kadianakis
2017-11-17Merge branch 'bug23817_031' into maint-0.3.2Nick Mathewson
2017-11-17Introduce new guard restriction and use it to skip outdated dirs.George Kadianakis
2017-11-17Introduce cache for outdated microdesc dirservers.George Kadianakis
We gonna use this cache to avoid dirservers without outdated md info.
2017-11-16relay: Avoid extra LOG_NOTICE for every new descriptor batchDavid Goulet
Commit 56c5e282a733912776f6dacbe4f5df66b4fb9606 suppressed that same log statement in directory_info_has_arrived() for microdescriptors so do the same for the descriptors. As the commit says, we already have the bootstrap progress for this. Fixes #23861 Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-11-14Silence a warning about failed descriptor uploads.George Kadianakis
Due to #23662 this can happen under natural causes and does not disturb the functionality of the service. This is a simple 0.3.2 fix for now, and we plan to fix this properly in 0.3.3.
2017-11-13Merge branch 'maint-0.3.0' into maint-0.3.1Nick Mathewson
2017-11-13Merge branch 'maint-0.2.9' into maint-0.3.0Nick Mathewson
2017-11-08Merge branch 'bug23816_029_squashed' into maint-0.3.2Nick Mathewson
2017-11-08Replace our random-exponential-delay algorithm.Nick Mathewson
This patch has implementations of the "decorrelated" and "full" algorithms from https://www.awsarchitectureblog.com/2015/03/backoff.html
2017-10-26Remove a duplicate call to update_microdesc_downloads()George Kadianakis
This call happens before we update our entry guards, so it needs to be removed for the fix to #23862 to work.
2017-10-23Remove the length limit from write_http_status_lineNick Mathewson
Fixes bug 23908; bugfix on 0.3.1.6-rc when we made the keypin failure message really long. Backport from 0.3.2's 771fb7e7baa789c55ba15c4c26c8a4889ff9fe8d, where arma said "get rid of the scary 256-byte-buf landmine".
2017-09-15Merge branch 'scan-build-032'Nick Mathewson
2017-09-15Avoid an instance of the bug warning in any_bridge_descriptors_known()teor
Part of 23524.
2017-09-14Rename write_http_status_line, since it does more now.Nick Mathewson
2017-09-14Make missing reason_phrase into a BUG().Nick Mathewson
2017-09-14get rid of the scary 256-byte-buf landmineRoger Dingledine
2017-09-14Make dir servers include a "Date:" http header more oftenRoger Dingledine
Directory servers now include a "Date:" http header for response codes other than 200. Clients starting with a skewed clock and a recent consensus were getting "304 Not modified" responses from directory authorities, so without a Date header the client would never hear about a wrong clock. Fixes bug 23499; bugfix on 0.0.8rc1.
2017-09-13get rid of a case where we might log a NULL as %sRoger Dingledine
this doesn't happen in our current code, and now it can't
2017-09-13Merge remote-tracking branch 'teor/bug23470-029'Nick Mathewson
2017-09-13Stop relays calling directory_fetches_from_authorities on dir downloadsteor
This change refactors find_dl_schedule() to only call dependent functions as needed. In particular, directory_fetches_from_authorities() only needs to be called on clients. Stopping spurious directory_fetches_from_authorities() calls on every download on public relays has the following impacts: * fewer address resolution attempts, particularly those mentioned in 21789 * fewer descriptor rebuilds * fewer log messages, particularly those limited in 20610 Fixes 23470 in 0.2.8.1-alpha. The original bug was introduced in commit 35bbf2e as part of prop210.
2017-09-12clang scan-build: Fix "dead increment" warnings.Nick Mathewson
For the most part, these indicated a spot where the code could have been better.
2017-09-12Merge branch 'bug23347_squashed'Nick Mathewson
2017-09-12Make clients wait to refresh bridges when they have a recent descriptorteor
But when clients are just starting, make them try each bridge a few times before giving up on it. These changes make the bridge download schedules more explicit: before 17750, they relied on undocumented behaviour and specific schedule entries. (And between 17750 and this fix, they were broken.) Fixes 23347, not in any released version of tor.
2017-09-12Make bridge clients download bridge descriptors immediatelyteor
The download schedule tells Tor to wait 15 minutes before downloading bridge descriptors. But 17750 made Tor ignore that and start immediately. Since we fixed 17750, Tor waits 15 minutes for bridge client bootstrap, like the schedule says. This fixes the download schedule to start immediately, and to try each bridge 3 times in the first 30 seconds. This should make bridge bootstraps more reliable. Fixes 23347.
2017-09-05Make url-canonicalizer canonicalize correctly.Nick Mathewson
2017-09-05Fix an erroneous !Nick Mathewson
2017-09-05Merge branch 'http_tunnel_squashed'Nick Mathewson
2017-09-05Export http-command parsing functions.Nick Mathewson
2017-09-05Repair buffer API so everything starts with buf_.Nick Mathewson
Our convention is that functions which manipulate a type T should be named T_foo. But the buffer functions were super old, and followed all kinds of conventions. Now they're uniform. Here's the perl I used to do this: \#!/usr/bin/perl -w -i -p s/read_to_buf\(/buf_read_from_socket\(/; s/flush_buf\(/buf_flush_to_socket\(/; s/read_to_buf_tls\(/buf_read_from_tls\(/; s/flush_buf_tls\(/buf_flush_to_tls\(/; s/write_to_buf\(/buf_add\(/; s/write_to_buf_compress\(/buf_add_compress\(/; s/move_buf_to_buf\(/buf_move_to_buf\(/; s/peek_from_buf\(/buf_peek\(/; s/fetch_from_buf\(/buf_get_bytes\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/fetch_from_buf_line\(/buf_get_line\(/; s/buf_remove_from_front\(/buf_drain\(/; s/peek_buf_startswith\(/buf_peek_startswith\(/; s/assert_buf_ok\(/buf_assert_ok\(/;
2017-08-24prop224: Add directory_request_fetch_set_hs_ident()David Goulet
Needed by the client when fetching a descriptor. This function checks the directory purpose and hard assert if it is not for fetching. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Client callback when descriptor has arrivedDavid Goulet
When a descriptor fetch has completed and it has been successfully stored in the client cache, this callback will take appropriate actions to attach streams and/or launch neede circuits to connect to the service. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24test: Add tests for fetching descs and handling SOCKS conns.George Kadianakis
- Add tests that ensure that SOCKS requests for v2/v3 addresses get intercepted and handled. - Add test that stores and lookups an HS descriptor in the client-side cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add the dir purpose HAS_FETCHEDDavid Goulet
Once a descriptor has been successfully downloaded from an HSDir, we flag the directory connection to "has fetched descriptor" so the connection subsystem doesn't trigger a new fetch on success. Same has DIR_PURPOSE_HAS_FETCHED_RENDDESC_V2 but for prop224. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add client code to handle fetched HS descriptors.George Kadianakis
This code handles received HS descriptors by storing them in the client-side HS cache. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Introduce v2/v3 HS desc fetch retry functionality.George Kadianakis
Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-24prop224: Add code that launches v3 HS desc fetches.George Kadianakis
Entry point is hs_client_refetch_v3_renddesc(). Will be used in subsequent commits. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-08-08Do more type checking when setting HS idents.George Kadianakis
I repurposed the old directory_request_set_hs_ident() into a new directory_request_upload_set_hs_ident() which is only used for the upload purpose and so it can assert on the dir_purpose. When coding the client-side we can make a second function for fetch.
2017-08-08prop224: Directory function to upload descriptorDavid Goulet
This commit adds a directory command function to make an upload directory request for a service descriptor. It is not used yet, just the groundwork. Signed-off-by: David Goulet <dgoulet@torproject.org>
2017-07-07Merge branch 'bug17750_029_squashed'Nick Mathewson
2017-07-07Comment that failure schedules always use exponential backoffteor
2017-07-07Refactor exponential backoff multipliers into macrosteor
There are only so many times you can type "4".
2017-07-07Use download_status_get_next_attempt_at() more oftenteor
This guards against future occurrences of 17750.
2017-07-07Give correct bounds in next_random_exponential_delay() commentteor
2017-07-07Make clients try fallbacks before authoritiesteor
Make clients wait for 6 seconds before trying to download their consensus from an authority. Fixes bug 17750, bugfix on 0.2.8.1-alpha.
2017-06-29Merge branch 'maint-0.3.1'Nick Mathewson
2017-06-29Merge remote-tracking branch 'public/bug22670_031' into maint-0.3.1Nick Mathewson
2017-06-27Merge branch 'maint-0.3.1'Nick Mathewson
2017-06-27Return "304 not modified" if a client already have the most recent consensus.Alexander Færøy
This makes our directory code check if a client is trying to fetch a document that matches a digest from our latest consensus document. See: https://bugs.torproject.org/22702
2017-06-21Convert authdir_mode_handles_descs(options, -1) with authdir_mode(options)huyvq