summaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2016-05-31 14:51:30 -0400
committerDavid Goulet <dgoulet@torproject.org>2016-11-04 10:29:26 -0400
commit8293356ad993e06c66e6b56534be91fb912c9b5a (patch)
treeb7d5154e060674365df36be054b6112364f66432 /src/or/connection.c
parent8fe410e875343a4c134ddbe0db6da3d38865deee (diff)
downloadtor-8293356ad993e06c66e6b56534be91fb912c9b5a.tar.gz
tor-8293356ad993e06c66e6b56534be91fb912c9b5a.zip
hs: Refactor rend_data_t for multi version support
In order to implement proposal 224, we need the data structure rend_data_t to be able to accomodate versionning that is the current version of hidden service (2) and the new version (3) and future version. For that, we implement a series of accessors and a downcast function to get the v2 data structure. rend_data_t becomes a top level generic place holder. The entire rend_data_t API has been moved to hs_common.{c|h} in order to seperate code that is shared from between HS versions and unshared code (in rendcommon.c). Closes #19024 Signed-off-by: David Goulet <dgoulet@torproject.org> Signed-off-by: George Kadianakis <desnacked@riseup.net>
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 5ecd1ad7bf..73a8691810 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -38,6 +38,7 @@
#include "ext_orport.h"
#include "geoip.h"
#include "main.h"
+#include "hs_common.h"
#include "nodelist.h"
#include "policies.h"
#include "reasons.h"
@@ -4082,12 +4083,12 @@ connection_get_by_type_state_rendquery(int type, int state,
(type == CONN_TYPE_DIR &&
TO_DIR_CONN(conn)->rend_data &&
!rend_cmp_service_ids(rendquery,
- TO_DIR_CONN(conn)->rend_data->onion_address))
+ rend_data_get_address(TO_DIR_CONN(conn)->rend_data)))
||
(CONN_IS_EDGE(conn) &&
TO_EDGE_CONN(conn)->rend_data &&
!rend_cmp_service_ids(rendquery,
- TO_EDGE_CONN(conn)->rend_data->onion_address))
+ rend_data_get_address(TO_EDGE_CONN(conn)->rend_data)))
));
}