summaryrefslogtreecommitdiff
path: root/src/feature/rend
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2019-10-31 08:06:16 -0400
committerGeorge Kadianakis <desnacked@riseup.net>2019-11-27 14:52:09 +0200
commitcbc495453cb522db1584525a06d26386f5819e05 (patch)
tree8d9352106599b54df582339e4cf0c1bf45d1df65 /src/feature/rend
parent7f83c43594dcf13fb04352f5faa8db2cd86354c1 (diff)
downloadtor-cbc495453cb522db1584525a06d26386f5819e05.tar.gz
tor-cbc495453cb522db1584525a06d26386f5819e05.zip
hs-v3: Give a cleanup type to hs_circ_cleanup()
By centralizing the circuit cleanup type that is: on close, free and repurpose, some actions on the circuit can not happen for a certain cleanup type or for all types. This passes a cleanup type so the HS subsystem (v2 and v3) can take actions based on the type of cleanup. For instance, there is slow code that we do not run on a circuit close but rather only on free. Part of #32020 Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/rend')
-rw-r--r--src/feature/rend/rendclient.c2
-rw-r--r--src/feature/rend/rendclient.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/feature/rend/rendclient.c b/src/feature/rend/rendclient.c
index 632b00c852..14484f1ced 100644
--- a/src/feature/rend/rendclient.c
+++ b/src/feature/rend/rendclient.c
@@ -1254,7 +1254,7 @@ rend_parse_service_authorization(const or_options_t *options,
/** The given circuit is being freed. Take appropriate action if it is of
* interest to the client subsystem. */
void
-rend_client_circuit_cleanup(const circuit_t *circ)
+rend_client_circuit_cleanup_on_free(const circuit_t *circ)
{
int reason, orig_reason;
bool has_timed_out, ip_is_redundant;
diff --git a/src/feature/rend/rendclient.h b/src/feature/rend/rendclient.h
index da6f4646dc..63191737c4 100644
--- a/src/feature/rend/rendclient.h
+++ b/src/feature/rend/rendclient.h
@@ -12,6 +12,7 @@
#ifndef TOR_RENDCLIENT_H
#define TOR_RENDCLIENT_H
+#include "feature/hs/hs_circuit.h"
#include "feature/rend/rendcache.h"
void rend_client_purge_state(void);
@@ -47,7 +48,7 @@ rend_service_authorization_t *rend_client_lookup_service_authorization(
const char *onion_address);
void rend_service_authorization_free_all(void);
-void rend_client_circuit_cleanup(const circuit_t *circ);
+void rend_client_circuit_cleanup_on_free(const circuit_t *circ);
#endif /* !defined(TOR_RENDCLIENT_H) */