diff options
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 10 |
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. * |