aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2003-11-18 21:12:17 +0000
committerRoger Dingledine <arma@torproject.org>2003-11-18 21:12:17 +0000
commit25ac8857f3734bc7c0579173452e3087bfc13ca5 (patch)
treeb748907a7d283356f4c290863f79a9520a4dacc2 /src
parenta6595f4579d5d67eff58f735d5fae1af235d4a6e (diff)
downloadtor-25ac8857f3734bc7c0579173452e3087bfc13ca5.tar
tor-25ac8857f3734bc7c0579173452e3087bfc13ca5.tar.gz
bugfix: sometimes we closed a circ while cpuworker was cranking,
and it didn't notice svn:r841
Diffstat (limited to 'src')
-rw-r--r--src/or/circuit.c7
-rw-r--r--src/or/onion.c3
2 files changed, 8 insertions, 2 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index 1a673b256..09eb30b54 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -552,6 +552,10 @@ void circuit_close(circuit_t *circ) {
assert(circ);
circuit_remove(circ);
+ if(circ->state == CIRCUIT_STATE_ONIONSKIN_PENDING) {
+ onion_pending_remove(circ);
+ }
+
if(circ->n_conn)
connection_send_destroy(circ->n_circ_id, circ->n_conn);
for(conn=circ->n_streams; conn; conn=conn->next_stream) {
@@ -706,7 +710,6 @@ int circuit_launch_new(int failure_status) {
}
if(circuit_establish_circuit() < 0) {
- failures++;
return 0;
}
@@ -746,7 +749,7 @@ int circuit_establish_circuit(void) {
circ->n_port = firsthop->or_port;
if(options.OnionRouter) { /* we would be connected if he were up. but he's not. */
log_fn(LOG_INFO,"Route's firsthop isn't connected.");
- circuit_close(circ);
+ circuit_close(circ);
return -1;
}
diff --git a/src/or/onion.c b/src/or/onion.c
index 84f43e9e8..907bd6606 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -69,11 +69,14 @@ circuit_t *onion_next_task(void) {
return NULL; /* no onions pending, we're done */
assert(ol_list->circ);
+ assert(ol_list->circ->p_conn); /* make sure it's still valid */
+#if 0
if(!ol_list->circ->p_conn) {
log_fn(LOG_INFO,"ol_list->circ->p_conn null, must have died?");
onion_pending_remove(ol_list->circ);
return onion_next_task(); /* recurse: how about the next one? */
}
+#endif
assert(ol_length > 0);
circ = ol_list->circ;