summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorKarsten Loesing <karsten.loesing@gmx.net>2009-12-12 08:32:46 +0100
committerKarsten Loesing <karsten.loesing@gmx.net>2009-12-17 09:22:55 +0100
commite1e5c1b3aba96afbd6fa3b5ece262720dd45a80e (patch)
treef4d89ac71f472e1f26ad821b9bab2a4bdcd68619 /src/or/control.c
parent62c2a5a8838ac8eb97ab967e10e7a1e99d761d94 (diff)
downloadtor-e1e5c1b3aba96afbd6fa3b5ece262720dd45a80e.tar.gz
tor-e1e5c1b3aba96afbd6fa3b5ece262720dd45a80e.zip
Fix bridge statistics.
Fix statistics on client numbers by country as seen by bridges that were broken in 0.2.2.1-alpha. Also switch to reporting full 24-hour intervals instead of variable 12-to-48-hour intervals.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/src/or/control.c b/src/or/control.c
index c3567bdaf2..d3ed8587bd 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1755,21 +1755,10 @@ getinfo_helper_events(control_connection_t *control_conn,
"information", question);
}
} else if (!strcmp(question, "status/clients-seen")) {
- char geoip_start[ISO_TIME_LEN+1];
- size_t answer_len;
- char *geoip_summary = extrainfo_get_client_geoip_summary(time(NULL));
-
- if (!geoip_summary)
+ char *bridge_stats = geoip_get_bridge_stats_controller(time(NULL));
+ if (!bridge_stats)
return -1;
-
- answer_len = strlen("TimeStarted=\"\" CountrySummary=") +
- ISO_TIME_LEN + strlen(geoip_summary) + 1;
- *answer = tor_malloc(answer_len);
- format_iso_time(geoip_start, geoip_get_history_start());
- tor_snprintf(*answer, answer_len,
- "TimeStarted=\"%s\" CountrySummary=%s",
- geoip_start, geoip_summary);
- tor_free(geoip_summary);
+ *answer = bridge_stats;
} else {
return 0;
}
@@ -3846,10 +3835,9 @@ control_event_bootstrap_problem(const char *warn, int reason)
* from recently. Send a copy to the controller in case it wants to
* display it for the user. */
void
-control_event_clients_seen(const char *timestarted, const char *countries)
+control_event_clients_seen(const char *controller_str)
{
send_control_event(EVENT_CLIENTS_SEEN, 0,
- "650 CLIENTS_SEEN TimeStarted=\"%s\" CountrySummary=%s\r\n",
- timestarted, countries);
+ "650 CLIENTS_SEEN %s\r\n", controller_str);
}