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

Ticket3723 03 fixes #231

Closed
wants to merge 23 commits into from
Closed

Ticket3723 03 fixes #231

wants to merge 23 commits into from

Conversation

Projects
None yet
2 participants
@teor2345
Copy link
Contributor

@teor2345 teor2345 commented Jul 16, 2018

Juga's #195, with fixes

juga0 and others added 23 commits Jul 1, 2018
* add bwlist_headers argument to dirserv_read_measured_bandwidth
  in order to store all the headers found when parsing the file
* add bwlist_headers to networkstatus_t in order to store the
  the headers found by the previous function
* include the bandwidth headers as string in vote documents
* add test to check that dirserv_read_measured_bandwidth generates
  the bwlist_headers
when there are not bw file headers lines.
to avoid interpreting as headers extra lines that are not key_values
and add bw file terminator constant
If bandwidth file terminator is found, set end of headers flag
and do not store the line.
If it is not, parse a relay line and check whether it is a header
line.
also add tests for bw_file_headers.
Headers are all that is found before a correct relay line or
the terminator.
Tests include:
* a empty bandwidth file
* a bandwidth file with only timestamp
* a bandwidth file with v1.0.0 headers
* a bandwidth file with v1.0.0 headers and relay lines
* a bandwidth file with v1.1.0 headers and v1.0.0 relay lines
* a bandwidth file with v1.0.0 headers, malformed relay lines and
  relay lines
* a bandwidth file with v1.0.0 headers, malformed relay lines,
  relay lines and malformed relay lines
* a bandwidth file with v1.1.0 headers without terminator
* a bandwidth file with v1.1.0 headers with terminator
* a bandwidth file with v1.1.0 headers without terminator and
  relay lines
* a bandwidth file with v1.1.0 headers with terminator and relay
  lines
* a bandwidth file with v1.1.0 headers without terminator, bad
  relay lines and relay lines
* a bandwidth file with v1.1.0 headers with terminator, bad relay
  lines and relay lines
and complete v1.0.0 bandwidth file
master compiles without this header, so we probably don't need it
Windows compilation fails because time_t is not a long int.

Instead, cast time_t back to an unsigned long, because that's
what we parsed it as.
If an authority is not configured with a V3BandwidthsFile, this line
SHOULD NOT appear in its vote.

If an authority is configured with a V3BandwidthsFile, but parsing
fails, this line SHOULD appear in its vote, but without any headers.

Part of 3723, implements the spec in 26799.
@teor2345 teor2345 self-assigned this Jul 16, 2018
@teor2345
Copy link
Contributor Author

@teor2345 teor2345 commented Jul 18, 2018

Obsoleted by #241

@teor2345 teor2345 closed this Jul 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment