diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-04-06 05:33:32 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-04-06 05:33:32 +0000 |
commit | b7cdcf34622eff7e2d805452e94883e8bd94f5d6 (patch) | |
tree | 0dfc4c1e18c0f15dc3f73255dbbb26d4096ff281 /src/or/command.c | |
parent | 712d05c19a8730e9a34118b68d8a78f767cbb285 (diff) | |
download | tor-b7cdcf34622eff7e2d805452e94883e8bd94f5d6.tar.gz tor-b7cdcf34622eff7e2d805452e94883e8bd94f5d6.zip |
Hopefully, this will make ORs much faster, and not break them: keep a big splay tree of (circid,orconn)->circuit mappings to make circuit_get_by_circid_conn much faster.
svn:r4020
Diffstat (limited to 'src/or/command.c')
-rw-r--r-- | src/or/command.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/command.c b/src/or/command.c index 98bbae252c..30b81b213b 100644 --- a/src/or/command.c +++ b/src/or/command.c @@ -173,7 +173,7 @@ static void command_process_create_cell(cell_t *cell, connection_t *conn) { conn->circ_id_type = CIRC_ID_TYPE_HIGHER; } - circ = circuit_get_by_circ_id_conn(cell->circ_id, conn); + circ = circuit_get_by_circid_orconn(cell->circ_id, conn); if (circ) { log_fn(LOG_WARN,"received CREATE cell (circID %d) for known circ. Dropping.", cell->circ_id); @@ -205,7 +205,7 @@ static void command_process_create_cell(cell_t *cell, connection_t *conn) { static void command_process_created_cell(cell_t *cell, connection_t *conn) { circuit_t *circ; - circ = circuit_get_by_circ_id_conn(cell->circ_id, conn); + circ = circuit_get_by_circid_orconn(cell->circ_id, conn); if (!circ) { log_fn(LOG_INFO,"(circID %d) unknown circ (probably got a destroy earlier). Dropping.", cell->circ_id); @@ -245,7 +245,7 @@ static void command_process_created_cell(cell_t *cell, connection_t *conn) { static void command_process_relay_cell(cell_t *cell, connection_t *conn) { circuit_t *circ; - circ = circuit_get_by_circ_id_conn(cell->circ_id, conn); + circ = circuit_get_by_circid_orconn(cell->circ_id, conn); if (!circ) { log_fn(LOG_INFO,"unknown circuit %d on connection to %s:%d. Dropping.", @@ -290,7 +290,7 @@ static void command_process_relay_cell(cell_t *cell, connection_t *conn) { static void command_process_destroy_cell(cell_t *cell, connection_t *conn) { circuit_t *circ; - circ = circuit_get_by_circ_id_conn(cell->circ_id, conn); + circ = circuit_get_by_circid_orconn(cell->circ_id, conn); if (!circ) { log_fn(LOG_INFO,"unknown circuit %d on connection to %s:%d. Dropping.", @@ -305,10 +305,10 @@ static void command_process_destroy_cell(cell_t *cell, connection_t *conn) { if (cell->circ_id == circ->p_circ_id) { /* the destroy came from behind */ - circ->p_conn = NULL; + circuit_set_circid_orconn(circ, 0, NULL, P_CONN_CHANGED); circuit_mark_for_close(circ); } else { /* the destroy came from ahead */ - circ->n_conn = NULL; + circuit_set_circid_orconn(circ, 0, NULL, N_CONN_CHANGED); if (CIRCUIT_IS_ORIGIN(circ)) { circuit_mark_for_close(circ); } else { |