aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
Commit message (Expand)AuthorAge
* Completely refactor how FILENAME_PRIVATE works•••We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little. Nick Mathewson2013-07-10
* Merge remote-tracking branch 'linus/bug8532'Nick Mathewson2013-06-13
|\
| * Add support for offsetting the voting interval in order to bootstrap faster.•••A new option TestingV3AuthVotingStartOffset is added which offsets the starting time of the voting interval. This is possible only when TestingTorNetwork is set. This patch makes run_scheduled_events() check for new consensus downloads every second when TestingTorNetwork, instead of every minute. This should be fine, see #8532 for reasoning. This patch also brings MIN_VOTE_SECONDS and MIN_DIST_SECONDS down from 20 to 2 seconds, unconditionally. This makes sanity checking of misconfiguration slightly less sane. Addresses #8532. Linus Nordberg2013-06-08
* | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-06-13
|\ \ | |/ |/|
| * Make all consumers of microdesc_t.body tolerate NULL•••This is another fix to try to mitigate recurrences of 8031/8822. Nick Mathewson2013-06-12
* | Merge branch 'maint-0.2.4' into masterAndrea Shepard2013-05-07
|\|
| * Use a clearer idiom for node identity in router_counts_toward_thresholdsNick Mathewson2013-05-05
| * Fix 8833: crash bug from using NULL node->ri in dirserv.c•••It appears that moria1 crashed because of one instance of this (the one in router_counts_toward_thresholds). The other instance I fixed won't actually have broken anything, but I think it's more clear this way. Fixes bug 8833; bugfix on 0.2.4.12-alpha. Nick Mathewson2013-05-05
* | Merge remote-tracking branch 'origin/maint-0.2.4'Nick Mathewson2013-04-18
|\|
| * Add a boolean to flag-thresholds for "we have enough measured bandwidth"•••Implements #8711. Nick Mathewson2013-04-18
* | Merge remote-tracking branch 'origin/maint-0.2.4'•••Conflicts: src/common/crypto.c Nick Mathewson2013-04-18
|\|
| * Merge branch 'less_charbuf_rebased' into maint-0.2.4•••Conflicts: src/or/dirserv.c src/or/dirserv.h src/test/test_dir.c Nick Mathewson2013-04-18
| |\
| | * Add a quick-and-dirty-test for generate_v2_networkstatus.•••It sure is a good thing we can run each test in its own process, or else the amount of setup I needed to do to make this thing work would have broken all the other tests. Test mocking would have made this easier to write too. Nick Mathewson2013-04-18
| | * Refactor dirobj signature generation•••Now we can compute the hash and signature of a dirobj before concatenating the smartlist, and we don't need to play silly games with sigbuf and realloc any more. Nick Mathewson2013-04-18
| | * Refactor v2 networkstatus generation to avoid buffer-styleNick Mathewson2013-04-18
| | * Refactor routerstatus_format_entry to avoid character-buffersNick Mathewson2013-04-18
* | | Merge remote-tracking branch 'origin/maint-0.2.4'•••Conflicts: src/or/dirserv.c Nick Mathewson2013-04-14
|\| |
| * | Remove a now-empty if body; invert the sense of its conditionNick Mathewson2013-04-14
| * | Remvoe total_bandwidth and total_exit_bandwidth as unused.Nick Mathewson2013-04-14
| * | Rename all fields which measure bw in kb to end with _kbNick Mathewson2013-04-14
| * | Fix some KB/B confusion in flag threshold minima.Nick Mathewson2013-04-14
| * | Use credible_bandwidth uniformly in setting/using fast_bandwidth•••We were using credible_bandwidth to build the fast_bandwidth threshold, but comparing it to bandwidth_for_router. Nick Mathewson2013-04-11
| * | Use correct units for dirserv_get_{credible_bandwidth,bandwidth_for_router}•••We were mixing bandwidth file entries (which are in kilobytes) with router_get_advertised_bw() entries, which were in bytes. Also, use router_get_advertised_bandwidth_capped() for credible_bandwidth. Nick Mathewson2013-04-11
* | | fix trivial typoRoger Dingledine2013-04-12
|/ /
* | Set default minimum bandwidth for exit flag to zero for TestingTorNetworkAndrea Shepard2013-03-20
* | Let testing networks override ABSOLUTE_MIN_VALUE_FOR_FAST_FLAG•••This adds a new option to fix bug 8508 which broke chutney networks. The bug was introduced by 317d16de. Nick Mathewson2013-03-20
* | Merge remote-tracking branch 'public/bug6164' into maint-0.2.4Nick Mathewson2013-03-18
|\ \
| * | Clear up a comment about when an assertion could fire•••Resolves ticket 6164 Nick Mathewson2013-02-19
| |/
* | Improve comment for routers_with_measured_bw static var in dirserv.cAndrea Shepard2013-03-18
* | Improve comment on router_counts_toward_thresholds()Andrea Shepard2013-03-18
* | Add dirserv_has_measured_bw() predicate wrapper for dirserv_query_measured_bw...Andrea Shepard2013-03-18
* | Ignore advertised bandwidths if we have enough measured bandwidths availableAndrea Shepard2013-03-18
* | Better comment for dirserv_query_measured_bw_cache()Andrea Shepard2013-03-07
* | Use DIGESTMAP_FOREACH_MODIFY in dirserv_expire_measured_bw_cache() for concisionAndrea Shepard2013-03-07
* | Add unit test for dirserv measured bandwidth cacheAndrea Shepard2013-03-07
* | Make sure expiry check in dirserv_expire_measured_bw_cache() works if time_t ...Andrea Shepard2013-03-07
* | More constness in dirserv.cAndrea Shepard2013-03-07
* | Make dirserv_cache_measured_bw() use a const measured_bw_line_t *Andrea Shepard2013-03-07
* | Call dirserv_clear_measured_bw_cache() from dirserv_free_all()Andrea Shepard2013-03-05
* | Prefer measured bandwidths over advertised when computing things for votes on...Andrea Shepard2013-02-27
|/
* Merge branch 'bug2286_unit_test_squashed'Nick Mathewson2013-02-19
|\
| * Refactor storing of measured_bw versus Unmeasured=1.•••This patch moves the measured_bw field and the has_measured_bw field into vote_routerstatus_t, since only votes have 'Measured=XX' set on their weight line. I also added a new bw_is_unmeasured flag to routerstatus_t to represent the Unmeasured=1 flag on a w line. Previously, I was using has_measured_bw for this, which was quite incorrect: has_measured_bw means that the measured_bw field is set, and it's probably a mistake to have it serve double duty as meaning that 'baandwidth' represents a measured value. While making this change,I also found a harmless but stupid bug in dirserv_read_measured_bandwidths: It assumes that it's getting a smartlist of routerstatus_t, when really it's getting a smartlist of vote_routerstatus_t. C's struct layout rules mean that we could never actually get an error because of that, but it's still quite incorrect. I fixed that, and in the process needed to add two more sorting and searching helpers. Finally, I made the Unmeasured=1 flag get parsed. We don't use it for anything yet, but someday we might. This isn't complete yet -- the new 2286 unit test doesn't build. Nick Mathewson2013-02-19
* | Merge remote-tracking branch 'public/bug8158'Nick Mathewson2013-02-11
|\ \
| * | Refactor generating the m lines in a vote into its own functionNick Mathewson2013-02-08
| |/
* / Refactor resolve_my_address() so logs are more accurate / helpful•••It returns the method by which we decided our public IP address (explicitly configured, resolved from explicit hostname, guessed from interfaces, learned by gethostname). Now we can provide more helpful log messages when a relay guesses its IP address incorrectly (e.g. due to unexpected lines in /etc/hosts). Resolves ticket 2267. While we're at it, stop sending a stray "(null)" in some cases for the server status "EXTERNAL_ADDRESS" controller event. Resolves bug 8200. Roger Dingledine2013-02-11
|/
* Include a flag-thresholds line in each vote to describe flag cutoffs•••Implements ticket 8151. Nick Mathewson2013-02-04
* When we mark a node as a sybil, mark it down and reset its uptime to 0•••This prevents bug 8147, where such nodes would accrue points towards Guard, Fast, HSDir, and so on. Fixes bug 8147. Nick Mathewson2013-02-04
* Ignore tiny bandwidths entirely when computing thresholds•••Another bug 8145 fix. Nick Mathewson2013-02-04
* Increase the minimum value for the Fast flag to 4096.•••Fix for 8145. Nick Mathewson2013-02-04
* Refactor should-count-towards-thresholds test into new functionNick Mathewson2013-02-04