aboutsummaryrefslogtreecommitdiff
path: root/src/core/or/circuituse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2019-06-05 09:04:09 -0400
committerNick Mathewson <nickm@torproject.org>2019-06-05 09:04:09 -0400
commitb39a8d315dcbfae002c6ced7434b6afd5a5670d1 (patch)
tree1e8a0f08d70e1cbf18b58bcf63a5941e8ff64460 /src/core/or/circuituse.c
parent0c16ec4c0775db4a91a99cb935d2528233deafb2 (diff)
parent41b94722e5c93ec06911f9c63296a65ce295c1ea (diff)
downloadtor-b39a8d315dcbfae002c6ced7434b6afd5a5670d1.tar.gz
tor-b39a8d315dcbfae002c6ced7434b6afd5a5670d1.zip
Merge remote-tracking branch 'tor-github/pr/1053'
Diffstat (limited to 'src/core/or/circuituse.c')
-rw-r--r--src/core/or/circuituse.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/or/circuituse.c b/src/core/or/circuituse.c
index 485c389054..b3d5c6bb81 100644
--- a/src/core/or/circuituse.c
+++ b/src/core/or/circuituse.c
@@ -3068,6 +3068,12 @@ circuit_change_purpose(circuit_t *circ, uint8_t new_purpose)
if (circ->purpose == new_purpose) return;
+ /* Take specific actions if we are repurposing a hidden service circuit. */
+ if (circuit_purpose_is_hidden_service(circ->purpose) &&
+ !circuit_purpose_is_hidden_service(new_purpose)) {
+ hs_circ_repurpose(circ);
+ }
+
if (CIRCUIT_IS_ORIGIN(circ)) {
char old_purpose_desc[80] = "";