Commit d79e5d52 authored by teor's avatar teor
Browse files

relay/circuitbuild: Refactor circuit_extend()

Make the "else" case explicit at the end of the function.

Part of 33633.
parent 6d75f324
Loading
Loading
Loading
Loading
+13 −11
Original line number Diff line number Diff line
@@ -295,9 +295,10 @@ circuit_extend(struct cell_t *cell, struct circuit_t *circ)
     * OR_CONN_STATE_OPEN.
     */
    return 0;
  }

  tor_assert(!circ->n_hop); /* Connection is already established. */
  } else {
    /* Connection is already established.
     * So we need to extend the circuit to the next hop. */
    tor_assert(!circ->n_hop);
    circ->n_chan = n_chan;
    log_debug(LD_CIRC,
              "n_chan is %s.",
@@ -308,6 +309,7 @@ circuit_extend(struct cell_t *cell, struct circuit_t *circ)

    return 0;
  }
}

/** On a relay, accept a create cell, initialise a circuit, and send a
 * created cell back.