[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/maint-0.2.9] Avoid a double-mark bug when makring a pending circuit as "too old"



commit ec5fe41209add4b216029466774a6b7e833210ef
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Mar 15 09:19:00 2017 -0400

    Avoid a double-mark bug when makring a pending circuit as "too old"
    
    Fixes bug 20059; bugfix on 0.1.0.1-rc.
---
 changes/bug20059 | 3 +++
 src/or/onion.c   | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/changes/bug20059 b/changes/bug20059
new file mode 100644
index 000000000..091fab06d
--- /dev/null
+++ b/changes/bug20059
@@ -0,0 +1,3 @@
+  o Minor bugfixes (relay):
+    - Avoid a double-marked-circuit warning that can happen when we receive
+      DESTROY cells under heavy load. Fixes bug 20059; bugfix on 0.1.0.1-rc.
diff --git a/src/or/onion.c b/src/or/onion.c
index 1a0bcf106..de4b6a584 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -184,7 +184,9 @@ onion_pending_add(or_circuit_t *circ, create_cell_t *onionskin)
     onion_queue_entry_remove(head);
     log_info(LD_CIRC,
              "Circuit create request is too old; canceling due to overload.");
-    circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_RESOURCELIMIT);
+    if (! TO_CIRCUIT(circ)->marked_for_close) {
+      circuit_mark_for_close(TO_CIRCUIT(circ), END_CIRC_REASON_RESOURCELIMIT);
+    }
   }
   return 0;
 }



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits