]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make connection_or_get_by_ext_or_id() testing-only
authorNick Mathewson <nickm@torproject.org>
Wed, 19 Feb 2020 17:04:31 +0000 (12:04 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 19 Feb 2020 17:11:23 +0000 (12:11 -0500)
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.

src/feature/relay/ext_orport.c
src/feature/relay/ext_orport.h

index eada68347eee8c7f326f2185714ae2fe20035fb9..533400bff527d1cd3189ed84f58c380ac0ec1569 100644 (file)
@@ -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
index cf13c5d4209a4bec3d98b61008d025842747ef58..b09fe3b570fca8fc5e244f441f0c268a65b04105 100644 (file)
@@ -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) */