diff options
author | David Goulet <dgoulet@torproject.org> | 2022-10-13 10:32:16 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2022-10-26 15:16:48 -0400 |
commit | 98b98fd3ce767d9fd303908337fdae0a4d558d67 (patch) | |
tree | 882c6794371809dfe798fb15c96b9e1ea8c57717 /src/core/or/connection_edge.c | |
parent | 609a82a595db45603edc1d007a6657fe4c1b4f5f (diff) | |
download | tor-98b98fd3ce767d9fd303908337fdae0a4d558d67.tar.gz tor-98b98fd3ce767d9fd303908337fdae0a4d558d67.zip |
rephist: Track number of streams seen per type
Related to #40194
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core/or/connection_edge.c')
-rw-r--r-- | src/core/or/connection_edge.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index 7ba7ecc4c5..2a79d0cf58 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -4119,6 +4119,9 @@ connection_exit_begin_resolve(cell_t *cell, or_circuit_t *circ) if (rh.length > RELAY_PAYLOAD_SIZE) return -1; + /* Note the RESOLVE stream as seen. */ + rep_hist_note_stream(RELAY_COMMAND_RESOLVE); + /* This 'dummy_conn' only exists to remember the stream ID * associated with the resolve request; and to make the * implementation of dns.c more uniform. (We really only need to @@ -4241,6 +4244,10 @@ connection_exit_connect(edge_connection_t *edge_conn) return; } + /* Note the BEGIN stream as seen. We do this after the Exit policy check in + * order to only account for valid streams. */ + rep_hist_note_stream(RELAY_COMMAND_BEGIN); + #ifdef HAVE_SYS_UN_H if (conn->socket_family != AF_UNIX) { #else @@ -4336,6 +4343,9 @@ connection_exit_connect_dir(edge_connection_t *exitconn) log_info(LD_EXIT, "Opening local connection for anonymized directory exit"); + /* Note the BEGIN_DIR stream as seen. */ + rep_hist_note_stream(RELAY_COMMAND_BEGIN_DIR); + exitconn->base_.state = EXIT_CONN_STATE_OPEN; dirconn = dir_connection_new(tor_addr_family(&exitconn->base_.addr)); |