diff options
author | Nick Mathewson <nickm@torproject.org> | 2008-01-10 17:48:36 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2008-01-10 17:48:36 +0000 |
commit | 29b0f51a7387608dd79ff29ffc3f37b7c8543341 (patch) | |
tree | 12f73c2fde1a8f531041fb927cd8032dc4219b1b /src/or/directory.c | |
parent | 59fdab43cd21ccee2d8712111dc8ba81c7791150 (diff) | |
download | tor-29b0f51a7387608dd79ff29ffc3f37b7c8543341.tar.gz tor-29b0f51a7387608dd79ff29ffc3f37b7c8543341.zip |
r17553@catbus: nickm | 2008-01-10 12:18:27 -0500
Add connection_dir_is_encrypted() so that we can refrain from sending bridge descriptors over an unencrypted link.
svn:r13093
Diffstat (limited to 'src/or/directory.c')
-rw-r--r-- | src/or/directory.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index fbe8bdaaf3..19b401f6c2 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -718,6 +718,19 @@ directory_initiate_command(const char *address, uint32_t addr, } } +/** Return true iff anything we say on <b>conn</b> is being encrypted before + * we send it to the client/server. */ +int +connection_dir_is_encrypted(dir_connection_t *conn) +{ + /* Right now it's sufficient to see if conn is or has been linked, since + * the only thing it could be linked to is an edge connection on a + * circuit, and the only way it could have been unlinked is at the edge + * connection getting closed. + */ + return TO_CONN(conn)->linked; +} + /** Queue an appropriate HTTP command on conn-\>outbuf. The other args * are as in directory_initiate_command. */ |