summaryrefslogtreecommitdiff
path: root/src/or/circuituse.c
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-06-25 13:46:20 -0700
committerRobert Ransom <rransom.8774@gmail.com>2011-11-24 06:55:06 -0800
commit88e0026d2f0260bb5e3ce88bf2cdead6b521b6b3 (patch)
treed6e52093b49660e502bc2f17292a79848b3104bc /src/or/circuituse.c
parent296b8d0b10cc8e5d42c88284ed1b37b510f4a5bc (diff)
downloadtor-88e0026d2f0260bb5e3ce88bf2cdead6b521b6b3.tar.gz
tor-88e0026d2f0260bb5e3ce88bf2cdead6b521b6b3.zip
Send CIRC2 event when a circuit is cannibalized
Diffstat (limited to 'src/or/circuituse.c')
-rw-r--r--src/or/circuituse.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 1b91100649..cd288aba90 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -1215,14 +1215,23 @@ circuit_launch_by_extend_info(uint8_t purpose,
* internal circs rather than exit circs? -RD */
circ = circuit_find_to_cannibalize(purpose, extend_info, flags);
if (circ) {
+ uint8_t old_purpose = circ->_base.purpose;
+ struct timeval old_timestamp_created;
+
log_info(LD_CIRC,"Cannibalizing circ '%s' for purpose %d (%s)",
build_state_get_exit_nickname(circ->build_state), purpose,
circuit_purpose_to_string(purpose));
+
circuit_change_purpose(TO_CIRCUIT(circ), purpose);
/* reset the birth date of this circ, else expire_building
* will see it and think it's been trying to build since it
* began. */
tor_gettimeofday(&circ->_base.timestamp_created);
+
+ control_event_circuit_status_2(circ, CIRC2_EVENT_CANNIBALIZED,
+ (int)old_purpose,
+ &old_timestamp_created);
+
switch (purpose) {
case CIRCUIT_PURPOSE_C_ESTABLISH_REND:
case CIRCUIT_PURPOSE_S_ESTABLISH_INTRO: