aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection_or.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-07-18 15:51:29 -0400
committerNick Mathewson <nickm@torproject.org>2013-08-15 12:03:36 -0400
commitc342ea98791ccbeb67b1255816ca2e92167cefb0 (patch)
tree81a9f7a8ff193bfc4b4bfe863179057882d558e6 /src/or/connection_or.c
parent7da59721a9963862b7b19dbba4e55d010c296d34 (diff)
downloadtor-c342ea98791ccbeb67b1255816ca2e92167cefb0.tar
tor-c342ea98791ccbeb67b1255816ca2e92167cefb0.tar.gz
Unit tests for ext_or_id_map.
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r--src/or/connection_or.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 3711cfeb3..a55ca3aa0 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -197,6 +197,16 @@ connection_or_remove_from_ext_or_id_map(or_connection_t *conn)
memset(conn->ext_or_conn_id, 0, EXT_OR_CONN_ID_LEN);
}
+/** Return the connection whose ext_or_id is <b>id</b>. Return NULL if no such
+ * connection is found. */
+or_connection_t *
+connection_or_get_by_ext_or_id(const char *id)
+{
+ if (!orconn_ext_or_id_map)
+ return NULL;
+ return digestmap_get(orconn_ext_or_id_map, id);
+}
+
/** Deallocate the global Extended ORPort identifier list */
void
connection_or_clear_ext_or_id_map(void)