[tor-commits] [tor/master] Don't exit when marking a newly created _C_INTRODUCING circ for close

nickm at torproject.org nickm at torproject.org
Wed Dec 28 20:57:30 UTC 2011


commit 2b189a222b76bad7c194442819f3181151f0198f
Author: Robert Ransom <rransom.8774 at gmail.com>
Date:   Wed Dec 28 09:02:14 2011 -0800

    Don't exit when marking a newly created _C_INTRODUCING circ for close
---
 changes/bug4796      |    7 +++++++
 src/or/circuitlist.c |   18 +++++++++---------
 2 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/changes/bug4796 b/changes/bug4796
new file mode 100644
index 0000000..bcb795f
--- /dev/null
+++ b/changes/bug4796
@@ -0,0 +1,7 @@
+  o Minor bugfixes:
+
+    - Don't exit with an assertion failure when we mark a new
+      client-side hidden-service introduction circuit for close during
+      the process of creating it.  Bugfix on 0.2.3.6-alpha.  Fixes bug
+      4796; reported by murb.
+
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index daf2eef..4fa1888 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -1275,16 +1275,16 @@ _circuit_mark_for_close(circuit_t *circ, int reason, int line,
   } else if (circ->purpose == CIRCUIT_PURPOSE_C_INTRODUCING &&
              reason != END_CIRC_REASON_TIMEOUT) {
     origin_circuit_t *ocirc = TO_ORIGIN_CIRCUIT(circ);
-    tor_assert(ocirc->build_state->chosen_exit);
-    tor_assert(ocirc->rend_data);
-    log_info(LD_REND, "Failed intro circ %s to %s "
-             "(building circuit to intro point). "
-             "Marking intro point as possibly unreachable.",
-             safe_str_client(ocirc->rend_data->onion_address),
+    if (ocirc->build_state->chosen_exit && ocirc->rend_data) {
+      log_info(LD_REND, "Failed intro circ %s to %s "
+               "(building circuit to intro point). "
+               "Marking intro point as possibly unreachable.",
+               safe_str_client(ocirc->rend_data->onion_address),
            safe_str_client(build_state_get_exit_nickname(ocirc->build_state)));
-    rend_client_report_intro_point_failure(ocirc->build_state->chosen_exit,
-                                           ocirc->rend_data,
-                                           INTRO_POINT_FAILURE_UNREACHABLE);
+      rend_client_report_intro_point_failure(ocirc->build_state->chosen_exit,
+                                             ocirc->rend_data,
+                                             INTRO_POINT_FAILURE_UNREACHABLE);
+    }
   }
   if (circ->n_conn) {
     circuit_clear_cell_queue(circ, circ->n_conn);



More information about the tor-commits mailing list