Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

29018: ExtraInfoStatistics fixes and unit tests #709

Merged
19 commits merged into from Mar 26, 2019

Conversation

teor2345
Copy link
Contributor

No description provided.

When ExtraInfoStatistics is 0, stop including PaddingStatistics in
relay and bridge extra-info documents.

Fixes bug 29017; bugfix on 0.3.1.1-alpha.
When ExtraInfoStatistics is 0, stop including bandwidth usage statistics,
GeoIPFile hashes, ServerTransportPlugin lines, and bridge statistics
by country in extra-info documents.

Fixes bug 29018; bugfix on 0.2.4.1-alpha (and earlier versions).
Split the body of router_build_fresh_descriptor() into static functions,
by inserting function prologues and epilogues between existing sections.

Write a new body for router_build_fresh_descriptor() that calls the new
static functions.

Initial refactor with no changes to the body of the old
router_build_fresh_descriptor(), except for the split.

Preparation for testing 29017 and 20918.
…rfaces

Tidy the arguments and return values of these functions, and clean up their
memory management.

Preparation for testing 29017 and 20918.
…tions

Make sure that these static functions aren't passed NULL.
If they are, log a BUG() warning, and return an error.

Preparation for testing 29017 and 20918.
Remove some tiny static functions called by router_build_fresh_descriptor(),
and move their code into more relevant functions.

Then, give router_update_{router,extra}info_descriptor_body identical layouts.

Preparation for testing 29017 and 20918.
Remove router_update_info_send_unencrypted(), and move its code into the
relevant functions.

Then, re-use an options pointer.

Preparation for testing 29017 and 20918.
This refactoring improves the structure of router_build_fresh_descriptor().

Preparation for testing 29017 and 20918.
…tors

Also, explicitly state when routerinfos and extra-infos are signed.
And tidy up some other comments.

Preparation for testing 29017 and 20918.
Add comment in
test_router_dump_router_to_string_no_bridge_distribution_method to explain
the effect of a mocked function.
Also fix a missing mock in rsa-only parsing.
Also:
* delete some obsolete code that was #if 0
* improve cleanup on failure
* make the dir_format tests more consistent with each other
* construct the descriptors using smartlist chunks

This refactor is incomplete, because removing the remaining duplicate
code would be time-consuming.

Part of 29017 and 29018.
Including:
* relays and bridges,
* no stats, basic stats, and all stats

Part of 29017 and 29018.
@coveralls
Copy link

Pull Request Test Coverage Report for Build 3861

  • 69 of 106 (65.09%) changed or added relevant lines in 3 files are covered.
  • 482 unchanged lines in 5 files lost coverage.
  • Overall coverage increased (+0.2%) to 61.993%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/feature/relay/routerkeys.c 3 5 60.0%
src/feature/relay/router.c 65 100 65.0%
Files with Coverage Reduction New Missed Lines %
src/feature/relay/routerkeys.c 2 81.16%
src/core/crypto/relay_crypto.c 5 85.0%
src/core/or/circuitlist.c 23 57.68%
src/core/or/circuitpadding.c 26 93.71%
src/core/or/circuituse.c 426 29.58%
Totals Coverage Status
Change from base Build 3824: 0.2%
Covered Lines: 45542
Relevant Lines: 73463

💛 - Coveralls

@ghost ghost merged commit 6c652ea into torproject:master Mar 26, 2019
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants