aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-04-06 05:45:07 +0000
committerNick Mathewson <nickm@torproject.org>2005-04-06 05:45:07 +0000
commit2a0b1025e5b69fda664ef47f51309ae7c23384f4 (patch)
tree3eb88bef9fd28a2cca48bb2abba0fe4e00e9bc3e
parentb34d9adb59c358de44584e6b0f88ed1df9145ece (diff)
downloadtor-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.c9
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;