aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/or/cpuworker.c1
-rw-r--r--src/or/or.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 7fe2351979..c5e78ed716 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -556,6 +556,7 @@ cpuworker_cancel_circ_handshake(or_circuit_t *circ)
tor_free(job);
tor_assert(total_pending_tasks > 0);
--total_pending_tasks;
+ /* if (!job), this is done in cpuworker_onion_handshake_replyfn. */
circ->workqueue_entry = NULL;
}
}
diff --git a/src/or/or.h b/src/or/or.h
index 520b7dba89..5d70798d8e 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -3126,7 +3126,8 @@ typedef struct or_circuit_t {
* chance to give an onionskin to a cpuworker. Used only in onion.c */
struct onion_queue_t *onionqueue_entry;
/** Pointer to a workqueue entry, if this circuit has given an onionskin to
- * a cpuworker and is waiting for a response. Used only in cpuworker.c */
+ * a cpuworker and is waiting for a response. Used to decide whether it is
+ * safe to free a circuit or if it is still in use by a cpuworker. */
struct workqueue_entry_s *workqueue_entry;
/** The circuit_id used in the previous (backward) hop of this circuit. */