diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-11-21 17:14:04 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-11-30 14:42:53 -0500 |
commit | 1fd0a547bb6af73cbc32be06ffbf6233eb9050a6 (patch) | |
tree | 005f2a26edc6a5c82d1b8f255ba448532e049c5a /src/or/channeltls.c | |
parent | 8dc6048c02806e8d30740c5a2a0dd11476909ce4 (diff) | |
download | tor-1fd0a547bb6af73cbc32be06ffbf6233eb9050a6.tar.gz tor-1fd0a547bb6af73cbc32be06ffbf6233eb9050a6.zip |
New function to tell the guard module "We're on the net!"
(Call it whenever we read a cell.)
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r-- | src/or/channeltls.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c index 9fb309d0fd..02b783a8e3 100644 --- a/src/or/channeltls.c +++ b/src/or/channeltls.c @@ -49,6 +49,7 @@ #include "connection.h" #include "connection_or.h" #include "control.h" +#include "entrynodes.h" #include "link_handshake.h" #include "relay.h" #include "rephist.h" @@ -1095,6 +1096,10 @@ channel_tls_handle_cell(cell_t *cell, or_connection_t *conn) if (conn->base_.state == OR_CONN_STATE_OR_HANDSHAKING_V3) or_handshake_state_record_cell(conn, conn->handshake_state, cell, 1); + /* We note that we're on the internet whenever we read a cell. This is + * a fast operation. */ + entry_guards_note_internet_connectivity(get_guard_selection_info()); + switch (cell->command) { case CELL_PADDING: ++stats_n_padding_cells_processed; @@ -1273,6 +1278,10 @@ channel_tls_handle_var_cell(var_cell_t *var_cell, or_connection_t *conn) return; } + /* We note that we're on the internet whenever we read a cell. This is + * a fast operation. */ + entry_guards_note_internet_connectivity(get_guard_selection_info()); + /* Now handle the cell */ switch (var_cell->command) { |