|
@@ -3066,6 +3066,12 @@ circuit_change_purpose(circuit_t *circ, uint8_t new_purpose)
|
|
circ->purpose,
|
|
circ->purpose,
|
|
circuit_purpose_to_string(new_purpose),
|
|
circuit_purpose_to_string(new_purpose),
|
|
new_purpose);
|
|
new_purpose);
|
|
|
|
+
|
|
|
|
+ /* 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_cleanup(circ);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
old_purpose = circ->purpose;
|
|
old_purpose = circ->purpose;
|