diff options
author | Mike Perry <mikeperry-git@torproject.org> | 2023-08-15 15:04:38 +0000 |
---|---|---|
committer | Mike Perry <mikeperry-git@torproject.org> | 2023-08-15 15:05:25 +0000 |
commit | a56434a82beefcd6d4d465489edd972fc4d80dae (patch) | |
tree | 3f22f352f3ad4d7e222f98ea3353dc03217c5fdd | |
parent | 72164740a239d769c2b09b0dc875c072bed45c2b (diff) | |
download | tor-a56434a82beefcd6d4d465489edd972fc4d80dae.tar.gz tor-a56434a82beefcd6d4d465489edd972fc4d80dae.zip |
Bug 40834: Remove assert and add logs to track no-leg case
-rw-r--r-- | src/core/or/conflux.c | 8 | ||||
-rw-r--r-- | src/core/or/relay.c | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/core/or/conflux.c b/src/core/or/conflux.c index eb004b3626..ab464f3446 100644 --- a/src/core/or/conflux.c +++ b/src/core/or/conflux.c @@ -467,8 +467,12 @@ conflux_decide_circ_for_send(conflux_t *cfx, * so these commands arrive in-order. */ if (!new_circ && relay_command != RELAY_COMMAND_DATA) { /* Curr leg should be set, because conflux_decide_next_circ() should - * have set it earlier. */ - tor_assert(cfx->curr_leg); + * have set it earlier. No BUG() here because the only caller BUG()s. */ + if (!cfx->curr_leg) { + log_warn(LD_BUG, "No current leg for conflux with relay command %d", + relay_command); + return NULL; + } return cfx->curr_leg->circ; } diff --git a/src/core/or/relay.c b/src/core/or/relay.c index 3af9435a76..893daa09fd 100644 --- a/src/core/or/relay.c +++ b/src/core/or/relay.c @@ -639,7 +639,8 @@ relay_send_command_from_edge_,(streamid_t stream_id, circuit_t *orig_circ, circ = conflux_decide_circ_for_send(orig_circ->conflux, orig_circ, relay_command); if (BUG(!circ)) { - log_warn(LD_BUG, "No circuit to send on for conflux"); + log_warn(LD_BUG, "No circuit to send for conflux for relay command %d, " + "called from %s:%d", relay_command, filename, lineno); circ = orig_circ; } else { /* Conflux circuits always send multiplexed relay commands to |