summaryrefslogtreecommitdiff
path: root/src/or/control.c
diff options
context:
space:
mode:
authorMike Perry <mikeperry-git@torproject.org>2018-04-23 20:14:48 +0000
committerMike Perry <mikeperry-git@torproject.org>2018-05-09 21:23:11 +0000
commit1268baee9e182afd764bc0e2bb68e205349f4376 (patch)
tree32694390dd8bd5ad4bd4e1a58ad744300baa2685 /src/or/control.c
parente07e95edd35f1608ecba94b281818d27f63812e3 (diff)
downloadtor-1268baee9e182afd764bc0e2bb68e205349f4376.tar.gz
tor-1268baee9e182afd764bc0e2bb68e205349f4376.zip
Bug 25903: Report new CIRC_BW fields to control port.
Diffstat (limited to 'src/or/control.c')
-rw-r--r--src/or/control.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/or/control.c b/src/or/control.c
index dda8872182..ca2271b769 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -257,6 +257,8 @@ clear_circ_bw_fields(void)
continue;
ocirc = TO_ORIGIN_CIRCUIT(circ);
ocirc->n_written_circ_bw = ocirc->n_read_circ_bw = 0;
+ ocirc->n_overhead_written_circ_bw = ocirc->n_overhead_read_circ_bw = 0;
+ ocirc->n_delivered_written_circ_bw = ocirc->n_delivered_read_circ_bw = 0;
}
SMARTLIST_FOREACH_END(circ);
}
@@ -5908,13 +5910,20 @@ control_event_circ_bandwidth_used(void)
tor_gettimeofday(&now);
format_iso_time_nospace_usec(tbuf, &now);
send_control_event(EVENT_CIRC_BANDWIDTH_USED,
- "650 CIRC_BW ID=%d READ=%lu WRITTEN=%lu "
- "TIME=%s\r\n",
+ "650 CIRC_BW ID=%d READ=%lu WRITTEN=%lu TIME=%s "
+ "DELIVERED_READ=%lu OVERHEAD_READ=%lu "
+ "DELIVERED_WRITTEN=%lu OVERHEAD_WRITTEN=%lu\r\n",
ocirc->global_identifier,
(unsigned long)ocirc->n_read_circ_bw,
(unsigned long)ocirc->n_written_circ_bw,
- tbuf);
+ tbuf,
+ (unsigned long)ocirc->n_delivered_read_circ_bw,
+ (unsigned long)ocirc->n_overhead_read_circ_bw,
+ (unsigned long)ocirc->n_delivered_written_circ_bw,
+ (unsigned long)ocirc->n_overhead_written_circ_bw);
ocirc->n_written_circ_bw = ocirc->n_read_circ_bw = 0;
+ ocirc->n_overhead_written_circ_bw = ocirc->n_overhead_read_circ_bw = 0;
+ ocirc->n_delivered_written_circ_bw = ocirc->n_delivered_read_circ_bw = 0;
}
SMARTLIST_FOREACH_END(circ);