From 70b9e79700f85ac07b931a2c836b4d63d0ba70c1 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 27 Oct 2016 10:34:02 -0400 Subject: Slightly refactor and fix couple callsites Signed-off-by: David Goulet --- src/or/relay.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/or/relay.c') diff --git a/src/or/relay.c b/src/or/relay.c index aa29cc805e..f5e9a6bb8c 100644 --- a/src/or/relay.c +++ b/src/or/relay.c @@ -610,14 +610,13 @@ relay_send_command_from_edge_(streamid_t stream_id, circuit_t *circ, memset(&cell, 0, sizeof(cell_t)); cell.command = CELL_RELAY; - if (cpath_layer) { + if (CIRCUIT_IS_ORIGIN(circ)) { + tor_assert(cpath_layer); cell.circ_id = circ->n_circ_id; cell_direction = CELL_DIRECTION_OUT; - } else if (! CIRCUIT_IS_ORIGIN(circ)) { + } else { cell.circ_id = TO_OR_CIRCUIT(circ)->p_circ_id; cell_direction = CELL_DIRECTION_IN; - } else { - tor_assert(0); } memset(&rh, 0, sizeof(rh)); -- cgit v1.2.3-54-g00ecf