Merge remote-tracking branch 'karsten/task-5824'

This commit is contained in:
Nick Mathewson 2014-02-28 08:32:13 -05:00
commit 043329eeb6
4 changed files with 17 additions and 4 deletions

4
changes/bug5824 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Bridges now never collect statistics that were designed for relays.
Fix for bug 5824; bugfix on 0.2.3.8-alpha.

4
changes/bug5824-2 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfixes:
- Bridges now report complete directory request statistics. Related to
bug 5824; bugfix on 0.2.2.1-alpha.

View File

@ -1660,10 +1660,14 @@ options_act(const or_options_t *old_options)
time_t now = time(NULL);
int print_notice = 0;
/* If we aren't acting as a server, we can't collect stats anyway. */
/* Only collect directory-request statistics on relays and bridges. */
if (!server_mode(options)) {
options->CellStatistics = 0;
options->DirReqStatistics = 0;
}
/* Only collect other relay-only statistics on relays. */
if (!public_server_mode(options)) {
options->CellStatistics = 0;
options->EntryStatistics = 0;
options->ExitPortStatistics = 0;
}

View File

@ -556,8 +556,9 @@ geoip_note_client_seen(geoip_client_action_t action,
(!(options->BridgeRelay && options->BridgeRecordUsageByCountry)))
return;
} else {
if (options->BridgeRelay || options->BridgeAuthoritativeDir ||
!options->DirReqStatistics)
/* Only gather directory-request statistics if configured, and
* forcibly disable them on bridge authorities. */
if (!options->DirReqStatistics || options->BridgeAuthoritativeDir)
return;
}