summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-15 10:37:33 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-15 10:37:33 -0400
commit6c0fe9d07c40ce453b5c9c7a60cbfd13bf3ca6d7 (patch)
tree31d5b8440b128ec1ec4d231e219fea1e2eb7c596 /src/or/connection.c
parent1416f54d1eb2651e6b82ccbe35585ce71378de8a (diff)
downloadtor-6c0fe9d07c40ce453b5c9c7a60cbfd13bf3ca6d7.tar.gz
tor-6c0fe9d07c40ce453b5c9c7a60cbfd13bf3ca6d7.zip
Split listener_connection_t into its own header
For once, it's a type that is used almost nowhere else besides the logical place.
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 8c7341992d..11da4fc97f 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -116,6 +116,7 @@
#include "dir_connection_st.h"
#include "control_connection_st.h"
#include "entry_connection_st.h"
+#include "listener_connection_st.h"
#include "port_cfg_st.h"
static connection_t *connection_listener_new(
@@ -172,6 +173,15 @@ static smartlist_t *outgoing_addrs = NULL;
/**************************************************************/
+/** Convert a connection_t* to an listener_connection_t*; assert if the cast
+ * is invalid. */
+listener_connection_t *
+TO_LISTENER_CONN(connection_t *c)
+{
+ tor_assert(c->magic == LISTENER_CONNECTION_MAGIC);
+ return DOWNCAST(listener_connection_t, c);
+}
+
/**
* Return the human-readable name for the connection type <b>type</b>
*/