Browse Source

Avoid a double-mark bug when makring a pending circuit as "too old"

Fixes bug 20059; bugfix on 0.1.0.1-rc.
Nick Mathewson 7 years ago
parent
commit
ec5fe41209
2 changed files with 6 additions and 1 deletions
  1. 3 0
      changes/bug20059
  2. 3 1
      src/or/onion.c

+ 3 - 0
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.

+ 3 - 1
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;
 }