From 1fd0a547bb6af73cbc32be06ffbf6233eb9050a6 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Mon, 21 Nov 2016 17:14:04 -0500 Subject: New function to tell the guard module "We're on the net!" (Call it whenever we read a cell.) --- src/or/channeltls.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/or/channeltls.c') 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) { -- cgit v1.2.3-54-g00ecf