summaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-06-15 10:31:21 -0400
committerNick Mathewson <nickm@torproject.org>2018-06-15 10:31:21 -0400
commit1416f54d1eb2651e6b82ccbe35585ce71378de8a (patch)
treed634752c0f3d1f2d2aefec21819d31874adad4a6 /src/or/directory.c
parent3b917b2408748efb2ce84c2725e2e81ee0217e03 (diff)
downloadtor-1416f54d1eb2651e6b82ccbe35585ce71378de8a.tar.gz
tor-1416f54d1eb2651e6b82ccbe35585ce71378de8a.zip
Split dir_connection_t into its own header
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 7321a97fcc..65aaaa38a6 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -53,6 +53,7 @@
#include "dirauth/mode.h"
#include "dirauth/shared_random.h"
+#include "dir_connection_st.h"
#include "dir_server_st.h"
#include "entry_connection_st.h"
@@ -154,6 +155,15 @@ static void connection_dir_close_consensus_fetches(
/********* END VARIABLES ************/
+/** Convert a connection_t* to a dir_connection_t*; assert if the cast is
+ * invalid. */
+dir_connection_t *
+TO_DIR_CONN(connection_t *c)
+{
+ tor_assert(c->magic == DIR_CONNECTION_MAGIC);
+ return DOWNCAST(dir_connection_t, c);
+}
+
/** Return false if the directory purpose <b>dir_purpose</b>
* does not require an anonymous (three-hop) connection.
*