summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2020-02-19 12:04:31 -0500
committerNick Mathewson <nickm@torproject.org>2020-02-19 12:11:23 -0500
commitdf6191f620f92ce2196955a240c45da63c074fee (patch)
treeae7aaef47d3272298aaa04cf901e065963e6b8cf /src
parenta1a3a4d5854e1d44ab7ca7e2a117753a8284a704 (diff)
downloadtor-df6191f620f92ce2196955a240c45da63c074fee.tar.gz
tor-df6191f620f92ce2196955a240c45da63c074fee.zip
Make connection_or_get_by_ext_or_id() testing-only
Apparently it is only used by the unit tests: tor doesn't want it at all. I've opened a new ticket (33383) to we if we should remove this whole feature.
Diffstat (limited to 'src')
-rw-r--r--src/feature/relay/ext_orport.c2
-rw-r--r--src/feature/relay/ext_orport.h4
2 files changed, 4 insertions, 2 deletions
diff --git a/src/feature/relay/ext_orport.c b/src/feature/relay/ext_orport.c
index eada68347e..533400bff5 100644
--- a/src/feature/relay/ext_orport.c
+++ b/src/feature/relay/ext_orport.c
@@ -675,6 +675,7 @@ connection_or_remove_from_ext_or_id_map(or_connection_t *conn)
memset(conn->ext_or_conn_id, 0, EXT_OR_CONN_ID_LEN);
}
+#ifdef TOR_UNIT_TESTS
/** Return the connection whose ext_or_id is <b>id</b>. Return NULL if no such
* connection is found. */
or_connection_t *
@@ -684,6 +685,7 @@ connection_or_get_by_ext_or_id(const char *id)
return NULL;
return digestmap_get(orconn_ext_or_id_map, id);
}
+#endif
/** Deallocate the global Extended ORPort identifier list */
void
diff --git a/src/feature/relay/ext_orport.h b/src/feature/relay/ext_orport.h
index cf13c5d420..b09fe3b570 100644
--- a/src/feature/relay/ext_orport.h
+++ b/src/feature/relay/ext_orport.h
@@ -38,8 +38,6 @@ int connection_ext_or_start_auth(or_connection_t *or_conn);
void connection_or_set_ext_or_identifier(or_connection_t *conn);
void connection_or_remove_from_ext_or_id_map(or_connection_t *conn);
void connection_or_clear_ext_or_id_map(void);
-or_connection_t *connection_or_get_by_ext_or_id(const char *id);
-
int connection_ext_or_finished_flushing(or_connection_t *conn);
int connection_ext_or_process_inbuf(or_connection_t *or_conn);
@@ -91,9 +89,11 @@ STATIC int handle_client_auth_nonce(const char *client_nonce,
size_t client_nonce_len,
char **client_hash_out,
char **reply_out, size_t *reply_len_out);
+
#ifdef TOR_UNIT_TESTS
extern uint8_t *ext_or_auth_cookie;
extern int ext_or_auth_cookie_is_set;
+or_connection_t *connection_or_get_by_ext_or_id(const char *id);
#endif
#endif /* defined(EXT_ORPORT_PRIVATE) */