diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-04-06 05:45:07 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-04-06 05:45:07 +0000 |
commit | 2a0b1025e5b69fda664ef47f51309ae7c23384f4 (patch) | |
tree | 3eb88bef9fd28a2cca48bb2abba0fe4e00e9bc3e | |
parent | b34d9adb59c358de44584e6b0f88ed1df9145ece (diff) | |
download | tor-2a0b1025e5b69fda664ef47f51309ae7c23384f4.tar tor-2a0b1025e5b69fda664ef47f51309ae7c23384f4.tar.gz |
Fix bug in last commit when no circid can be found
svn:r4023
-rw-r--r-- | src/or/circuitbuild.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 8aa7549aa..c3e057d6c 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -385,19 +385,20 @@ void circuit_n_conn_done(connection_t *or_conn, int status) { static int circuit_deliver_create_cell(circuit_t *circ, char *payload) { cell_t cell; + uint16_t id; tor_assert(circ); tor_assert(circ->n_conn); tor_assert(circ->n_conn->type == CONN_TYPE_OR); tor_assert(payload); - circuit_set_circid_orconn(circ, get_unique_circ_id_by_conn(circ->n_conn), - circ->n_conn, N_CONN_CHANGED); - if (!circ->n_circ_id) { + id = get_unique_circ_id_by_conn(circ->n_conn); + if (!id) { log_fn(LOG_WARN,"failed to get unique circID."); return -1; } - log_fn(LOG_DEBUG,"Chosen circID %u.",circ->n_circ_id); + log_fn(LOG_DEBUG,"Chosen circID %u.", id); + circuit_set_circid_orconn(circ, id, circ->n_conn, N_CONN_CHANGED); memset(&cell, 0, sizeof(cell_t)); cell.command = CELL_CREATE; |