summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-08-21 12:37:35 -0400
committerNick Mathewson <nickm@torproject.org>2013-08-22 10:15:57 -0400
commit8920fc545738393fc8320b61bac897f67a66e6c9 (patch)
tree06fef01046a2b1c765531a1ee47eebaf46193f66 /src/or/control.c
parent79cad08b4f9afd13a7151b8e15ae6481df82478f (diff)
downloadtor-8920fc545738393fc8320b61bac897f67a66e6c9.tar.gz
tor-8920fc545738393fc8320b61bac897f67a66e6c9.zip
Hide the contents of the circuit_build_times structure.
There were only two functions outside of circuitstats that actually wanted to know what was inside this. Making the structure itself hidden should help isolation and prevent us from spaghettifying the thing more.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/src/or/control.c b/src/or/control.c
index 81df00cf92..fc4809b399 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -4163,32 +4163,26 @@ control_event_newconsensus(const networkstatus_t *consensus)
/** Called when we compute a new circuitbuildtimeout */
int
-control_event_buildtimeout_set(const circuit_build_times_t *cbt,
- buildtimeout_set_event_t type)
+control_event_buildtimeout_set(buildtimeout_set_event_t type,
+ const char *args)
{
const char *type_string = NULL;
- double qnt;
if (!control_event_is_interesting(EVENT_BUILDTIMEOUT_SET))
return 0;
- qnt = circuit_build_times_quantile_cutoff();
-
switch (type) {
case BUILDTIMEOUT_SET_EVENT_COMPUTED:
type_string = "COMPUTED";
break;
case BUILDTIMEOUT_SET_EVENT_RESET:
type_string = "RESET";
- qnt = 1.0;
break;
case BUILDTIMEOUT_SET_EVENT_SUSPENDED:
type_string = "SUSPENDED";
- qnt = 1.0;
break;
case BUILDTIMEOUT_SET_EVENT_DISCARD:
type_string = "DISCARD";
- qnt = 1.0;
break;
case BUILDTIMEOUT_SET_EVENT_RESUME:
type_string = "RESUME";
@@ -4199,15 +4193,8 @@ control_event_buildtimeout_set(const circuit_build_times_t *cbt,
}
send_control_event(EVENT_BUILDTIMEOUT_SET, ALL_FORMATS,
- "650 BUILDTIMEOUT_SET %s TOTAL_TIMES=%lu "
- "TIMEOUT_MS=%lu XM=%lu ALPHA=%f CUTOFF_QUANTILE=%f "
- "TIMEOUT_RATE=%f CLOSE_MS=%lu CLOSE_RATE=%f\r\n",
- type_string, (unsigned long)cbt->total_build_times,
- (unsigned long)cbt->timeout_ms,
- (unsigned long)cbt->Xm, cbt->alpha, qnt,
- circuit_build_times_timeout_rate(cbt),
- (unsigned long)cbt->close_ms,
- circuit_build_times_close_rate(cbt));
+ "650 BUILDTIMEOUT_SET %s %s\r\n",
+ type_string, args);
return 0;
}