summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2010-09-29 17:17:59 -0400
committerRoger Dingledine <arma@torproject.org>2010-09-29 17:17:59 -0400
commit48cd096276590e40540bc255b2610931351b14cb (patch)
tree31653a7ee4bdc1ec46328afe73e7738f7eee0302 /src
parent474e4d2722d52cf225a88cb7b7c677273b8f50ac (diff)
parent4caf39f1c8db6acc25f84df024073d43c04c8645 (diff)
downloadtor-48cd096276590e40540bc255b2610931351b14cb.tar.gz
tor-48cd096276590e40540bc255b2610931351b14cb.zip
Merge commit 'mikeperry/bug1739' into maint-0.2.2
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitlist.c2
-rw-r--r--src/or/circuituse.c8
-rw-r--r--src/or/or.h4
-rw-r--r--src/or/reasons.c2
4 files changed, 14 insertions, 2 deletions
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index fa800db1a4..fb4b69be0d 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -368,7 +368,7 @@ circuit_purpose_to_controller_string(uint8_t purpose)
case CIRCUIT_PURPOSE_TESTING:
return "TESTING";
case CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT:
- return "EXPIRED";
+ return "MEASURE_TIMEOUT";
case CIRCUIT_PURPOSE_CONTROLLER:
return "CONTROLLER";
diff --git a/src/or/circuituse.c b/src/or/circuituse.c
index 36dc1c1643..1fbe5a82b9 100644
--- a/src/or/circuituse.c
+++ b/src/or/circuituse.c
@@ -389,6 +389,9 @@ circuit_expire_building(time_t now)
/* Circuits are allowed to last longer for measurement.
* Switch their purpose and wait. */
if (victim->purpose != CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT) {
+ control_event_circuit_status(TO_ORIGIN_CIRCUIT(victim),
+ CIRC_EVENT_FAILED,
+ END_CIRC_REASON_TIMEOUT);
victim->purpose = CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT;
/* Record this failure to check for too many timeouts
* in a row. This function does not record a time value yet
@@ -430,7 +433,10 @@ circuit_expire_building(time_t now)
circuit_state_to_string(victim->state), victim->purpose);
circuit_log_path(LOG_INFO,LD_CIRC,TO_ORIGIN_CIRCUIT(victim));
- circuit_mark_for_close(victim, END_CIRC_REASON_TIMEOUT);
+ if (victim->purpose == CIRCUIT_PURPOSE_C_MEASURE_TIMEOUT)
+ circuit_mark_for_close(victim, END_CIRC_REASON_MEASUREMENT_EXPIRED);
+ else
+ circuit_mark_for_close(victim, END_CIRC_REASON_TIMEOUT);
}
}
diff --git a/src/or/or.h b/src/or/or.h
index 69b0d6be29..7aee493b39 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -614,6 +614,10 @@ typedef enum {
/* Negative reasons are internal: we never send them in a DESTROY or TRUNCATE
* call; they only go to the controller for tracking */
+/** Our post-timeout circuit time measurement period expired.
+ * We must give up now */
+#define END_CIRC_REASON_MEASUREMENT_EXPIRED -3
+
/** We couldn't build a path for this circuit. */
#define END_CIRC_REASON_NOPATH -2
/** Catch-all "other" reason for closing origin circuits. */
diff --git a/src/or/reasons.c b/src/or/reasons.c
index ade9a3abfc..aa7972be5b 100644
--- a/src/or/reasons.c
+++ b/src/or/reasons.c
@@ -334,6 +334,8 @@ circuit_end_reason_to_control_string(int reason)
return "NOPATH";
case END_CIRC_REASON_NOSUCHSERVICE:
return "NOSUCHSERVICE";
+ case END_CIRC_REASON_MEASUREMENT_EXPIRED:
+ return "MEASUREMENT_EXPIRED";
default:
log_warn(LD_BUG, "Unrecognized reason code %d", (int)reason);
return NULL;