summaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-07 12:36:13 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-16 11:06:22 -0500
commit68679504323b0a676a446b8fb34b976c9dc66b4f (patch)
tree89a6a9621fae80e4c41114aee2d0f12aed437dcb /src/or/connection_or.c
parent2b4bfe62ee74b927d65923f5d07fe04f51f8779a (diff)
downloadtor-68679504323b0a676a446b8fb34b976c9dc66b4f.tar.gz
tor-68679504323b0a676a446b8fb34b976c9dc66b4f.zip
Wrap all of the legacy guard code, and its users, in #ifdefs
This will make it easier to see what we remove down the line.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 3b6f82c904..6233fb7669 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -737,9 +737,11 @@ connection_or_about_to_close(or_connection_t *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,
@@ -1678,9 +1680,11 @@ connection_or_client_learned_peer_id(or_connection_t *conn,
conn->base_.address, conn->base_.port, expected, seen, 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))