diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-02-27 10:53:12 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-02-27 10:53:12 -0500 |
commit | 0e7d2882f98df9a26e6a30170d39c7746d1b4ccd (patch) | |
tree | 9b2fe9d02287d809175045b0aaf0d1731f2595c1 /src/or/relay.c | |
parent | 17fa4988745f258896d197335ec55e96fedcfb5e (diff) | |
parent | 3848d236439d476793f03699519a818f26f56c6c (diff) | |
download | tor-0e7d2882f98df9a26e6a30170d39c7746d1b4ccd.tar.gz tor-0e7d2882f98df9a26e6a30170d39c7746d1b4ccd.zip |
Merge remote-tracking branch 'ahf/bugs/21206'
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/or/relay.c b/src/or/relay.c index 2e76a8ec36..6b3f34f3e5 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -732,6 +732,16 @@ connection_edge_send_command(edge_connection_t *fromconn, return -1; } +#ifdef MEASUREMENTS_21206 + /* Keep track of the number of RELAY_DATA cells sent for directory + * connections. */ + connection_t *linked_conn = TO_CONN(fromconn)->linked_conn; + + if (linked_conn && linked_conn->type == CONN_TYPE_DIR) { + ++(TO_DIR_CONN(linked_conn)->data_cells_sent); + } +#endif + return relay_send_command_from_edge(fromconn->stream_id, circ, relay_command, payload, payload_len, cpath_layer); @@ -1585,6 +1595,16 @@ connection_edge_process_relay_cell(cell_t *cell, circuit_t *circ, connection_write_to_buf((char*)(cell->payload + RELAY_HEADER_SIZE), rh.length, TO_CONN(conn)); +#ifdef MEASUREMENTS_21206 + /* Count number of RELAY_DATA cells received on a linked directory + * connection. */ + connection_t *linked_conn = TO_CONN(conn)->linked_conn; + + if (linked_conn && linked_conn->type == CONN_TYPE_DIR) { + ++(TO_DIR_CONN(linked_conn)->data_cells_received); + } +#endif + if (!optimistic_data) { /* Only send a SENDME if we're not getting optimistic data; otherwise * a SENDME could arrive before the CONNECTED. |