Bug 40834: Remove assert and add logs to track no-leg case

This commit is contained in:
Mike Perry 2023-08-15 15:04:38 +00:00
parent 72164740a2
commit a56434a82b
2 changed files with 8 additions and 3 deletions

View File

@ -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;
}

View File

@ -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