diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:20:59 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-12-16 11:20:59 -0500 |
commit | 2cee38f76a46860e2fb29fbd95ba36b332aa38c6 (patch) | |
tree | 3b2cbaeff1472c8d23c18f3e88bc4735bbb22bcc /src/or/connection_or.c | |
parent | b310929ee36f0a88389dca53124506115c850c3b (diff) | |
parent | 20292ec4974b777d430e7962cc38349c5f82b220 (diff) | |
download | tor-2cee38f76a46860e2fb29fbd95ba36b332aa38c6.tar.gz tor-2cee38f76a46860e2fb29fbd95ba36b332aa38c6.zip |
Merge branch 'prop271_030_v1_squashed'
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 635d3e416a..b3ae291831 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -21,6 +21,7 @@ * This module also implements the client side of the v3 Tor link handshake, **/ #include "or.h" +#include "bridges.h" #include "buffers.h" /* * Define this so we get channel internal functions, since we're implementing @@ -715,8 +716,13 @@ connection_or_about_to_close(or_connection_t *or_conn) const or_options_t *options = get_options(); connection_or_note_state_when_broken(or_conn); rep_hist_note_connect_failed(or_conn->identity_digest, now); + /* Tell the new guard API about the channel failure */ + entry_guard_chan_failed(TLS_CHAN_TO_BASE(or_conn->chan)); +#ifdef ENABLE_LEGACY_GUARD_ALGORITHM + /* Tell the old guard API about the channel failure */ entry_guard_register_connect_status(or_conn->identity_digest,0, !options->HTTPSProxy, now); +#endif if (conn->state >= OR_CONN_STATE_TLS_HANDSHAKING) { int reason = tls_error_to_orconn_end_reason(or_conn->tls_error); control_event_or_conn_status(or_conn, OR_CONN_EVENT_FAILED, @@ -1720,8 +1726,13 @@ connection_or_client_learned_peer_id(or_connection_t *conn, conn->base_.address, conn->base_.port, expected_rsa, expected_ed, seen_rsa, seen_ed, extra_log); + /* Tell the new guard API about the channel failure */ + entry_guard_chan_failed(TLS_CHAN_TO_BASE(conn->chan)); +#ifdef ENABLE_LEGACY_GUARD_ALGORITHM + /* Tell the old guard API about the channel failure */ entry_guard_register_connect_status(conn->identity_digest, 0, 1, time(NULL)); +#endif control_event_or_conn_status(conn, OR_CONN_EVENT_FAILED, END_OR_CONN_REASON_OR_IDENTITY); if (!authdir_mode_tests_reachability(options)) |