Skip to content
Snippets Groups Projects
Commit 8356cc5b authored by teor's avatar teor
Browse files

stats: Always publish pluggable transports in extra info documents

Always publish bridge pluggable transport information in the extra info
descriptor, even if ExtraInfoStatistics is 0. This information is
needed by BridgeDB.

Fixes bug 30956; bugfix on 0.4.1.1-alpha.
parent 4ecd09cf
No related branches found
No related tags found
No related merge requests found
o Minor bugfixes (pluggable transports):
- Always publish bridge pluggable transport information in the extra info
descriptor, even if ExtraInfoStatistics is 0. This information is
needed by BridgeDB. Fixes bug 30956; bugfix on 0.4.1.1-alpha.
...@@ -2451,8 +2451,10 @@ is non-zero): ...@@ -2451,8 +2451,10 @@ is non-zero):
[[ExtraInfoStatistics]] **ExtraInfoStatistics** **0**|**1**:: [[ExtraInfoStatistics]] **ExtraInfoStatistics** **0**|**1**::
When this option is enabled, Tor includes previously gathered statistics in When this option is enabled, Tor includes previously gathered statistics in
its extra-info documents that it uploads to the directory authorities. its extra-info documents that it uploads to the directory authorities.
Disabling this option also disables bandwidth usage statistics, GeoIPFile Disabling this option also removes bandwidth usage statistics, and
hashes, and ServerTransportPlugin lists in the extra-info file. GeoIPFile and GeoIPv6File hashes from the extra-info file. Bridge
ServerTransportPlugin lines are always includes in the extra-info file,
because they are required by BridgeDB.
(Default: 1) (Default: 1)
[[ExtendAllowPrivateAddresses]] **ExtendAllowPrivateAddresses** **0**|**1**:: [[ExtendAllowPrivateAddresses]] **ExtendAllowPrivateAddresses** **0**|**1**::
......
...@@ -3175,6 +3175,15 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo, ...@@ -3175,6 +3175,15 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
published); published);
smartlist_add(chunks, pre); smartlist_add(chunks, pre);
/* Add information about the pluggable transports we support, even if we
* are not publishing statistics. This information is needed by BridgeDB
* to distribute bridges. */
if (options->ServerTransportPlugin) {
char *pluggable_transports = pt_get_extra_info_descriptor_string();
if (pluggable_transports)
smartlist_add(chunks, pluggable_transports);
}
if (options->ExtraInfoStatistics && write_stats_to_extrainfo) { if (options->ExtraInfoStatistics && write_stats_to_extrainfo) {
log_info(LD_GENERAL, "Adding stats to extra-info descriptor."); log_info(LD_GENERAL, "Adding stats to extra-info descriptor.");
/* Bandwidth usage stats don't have their own option */ /* Bandwidth usage stats don't have their own option */
...@@ -3182,6 +3191,7 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo, ...@@ -3182,6 +3191,7 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
contents = rep_hist_get_bandwidth_lines(); contents = rep_hist_get_bandwidth_lines();
smartlist_add(chunks, contents); smartlist_add(chunks, contents);
} }
/* geoip hashes aren't useful unless we are publishing other stats */
if (geoip_is_loaded(AF_INET)) if (geoip_is_loaded(AF_INET))
smartlist_add_asprintf(chunks, "geoip-db-digest %s\n", smartlist_add_asprintf(chunks, "geoip-db-digest %s\n",
geoip_db_digest(AF_INET)); geoip_db_digest(AF_INET));
...@@ -3223,12 +3233,7 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo, ...@@ -3223,12 +3233,7 @@ extrainfo_dump_to_string(char **s_out, extrainfo_t *extrainfo,
if (contents) if (contents)
smartlist_add(chunks, contents); smartlist_add(chunks, contents);
} }
/* Add information about the pluggable transports we support. */ /* bridge statistics */
if (options->ServerTransportPlugin) {
char *pluggable_transports = pt_get_extra_info_descriptor_string();
if (pluggable_transports)
smartlist_add(chunks, pluggable_transports);
}
if (should_record_bridge_info(options)) { if (should_record_bridge_info(options)) {
const char *bridge_stats = geoip_get_bridge_stats_extrainfo(now); const char *bridge_stats = geoip_get_bridge_stats_extrainfo(now);
if (bridge_stats) { if (bridge_stats) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment