diff options
author | David Goulet <dgoulet@torproject.org> | 2016-10-27 10:34:02 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2016-10-27 10:34:02 -0400 |
commit | 70b9e79700f85ac07b931a2c836b4d63d0ba70c1 (patch) | |
tree | dbdaac6cc787b9455db16802d87d7b48bde9beca /src/or/relay.c | |
parent | 23b878b875d7feab195be0e856da4aa3f5ac2e15 (diff) | |
download | tor-70b9e79700f85ac07b931a2c836b4d63d0ba70c1.tar.gz tor-70b9e79700f85ac07b931a2c836b4d63d0ba70c1.zip |
Slightly refactor and fix couple callsites
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/or/relay.c')
-rw-r--r-- | src/or/relay.c | 7 |
1 files changed, 3 insertions, 4 deletions
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)); |