aboutsummaryrefslogtreecommitdiff
path: root/src/or/rendmid.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2014-12-02 12:20:35 +0000
committerNick Mathewson <nickm@torproject.org>2014-12-19 10:35:25 -0500
commit14e83e626be84c4f311b8e8f0d80ca141675fa9e (patch)
tree4e15bdc7b247fa007a4fe9a10f558e3a491ba8c4 /src/or/rendmid.c
parent7cd53b75c10831e01e288b01f63cab069d3e3035 (diff)
downloadtor-14e83e626be84c4f311b8e8f0d80ca141675fa9e.tar.gz
tor-14e83e626be84c4f311b8e8f0d80ca141675fa9e.zip
Add two hidden-service related statistics.
The two statistics are: 1. number of RELAY cells observed on successfully established rendezvous circuits; and 2. number of .onion addresses observed as hidden-service directory. Both statistics are accumulated over 24 hours, obfuscated by rounding up to the next multiple of a given number and adding random noise, and written to local file stats/hidserv-stats. Notably, no statistics will be gathered on clients or services, but only on relays.
Diffstat (limited to 'src/or/rendmid.c')
-rw-r--r--src/or/rendmid.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/or/rendmid.c b/src/or/rendmid.c
index 6a701e7a77..1c56471b8c 100644
--- a/src/or/rendmid.c
+++ b/src/or/rendmid.c
@@ -281,6 +281,7 @@ int
rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
size_t request_len)
{
+ const or_options_t *options = get_options();
or_circuit_t *rend_circ;
char hexid[9];
int reason = END_CIRC_REASON_INTERNAL;
@@ -316,6 +317,12 @@ rend_mid_rendezvous(or_circuit_t *circ, const uint8_t *request,
goto err;
}
+ /* Statistics: Mark this circuit as an RP circuit so that we collect
+ stats from it. */
+ if (options->HiddenServiceStatistics) {
+ circ->circuit_carries_hs_traffic_stats = 1;
+ }
+
/* Send the RENDEZVOUS2 cell to Alice. */
if (relay_send_command_from_edge(0, TO_CIRCUIT(rend_circ),
RELAY_COMMAND_RENDEZVOUS2,