summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-03-26 14:07:59 +0000
committerNick Mathewson <nickm@torproject.org>2007-03-26 14:07:59 +0000
commit38c0bb3a99956a0ff2e570bd8f2b900d46741992 (patch)
tree9a447e7b431abdc819d3ba1f30755f5b40678c79 /src/or/circuitbuild.c
parent6e51bdd5e4d5ab39fc1dca12e468b9a1c573cc1b (diff)
downloadtor-38c0bb3a99956a0ff2e570bd8f2b900d46741992.tar.gz
tor-38c0bb3a99956a0ff2e570bd8f2b900d46741992.zip
r12651@Kushana: nickm | 2007-03-24 18:26:42 -0400
Initial version of circuit-based cell queues. Instead of hammering or_conns with piles of cells, queue cells on their corresponding circuits, and append them to the or_conn as needed. This seems to work so far, but needs a bit more work. This will break the memory-use-limitation patch for begin_dir conns: the solution will be a fun but fiddly. svn:r9904
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index c7ac520059..7d1c5d9c4f 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -488,7 +488,7 @@ circuit_deliver_create_cell(circuit_t *circ, uint8_t cell_type,
cell.circ_id = circ->n_circ_id;
memcpy(cell.payload, payload, ONIONSKIN_CHALLENGE_LEN);
- connection_or_write_cell_to_buf(&cell, circ->n_conn);
+ append_cell_to_circuit_queue(circ, circ->n_conn, &cell, CELL_DIRECTION_OUT);
/* mark it so it gets better rate limiting treatment. */
circ->n_conn->client_used = 1;
@@ -650,7 +650,7 @@ circuit_send_next_onion_skin(origin_circuit_t *circ)
return - END_CIRC_REASON_INTERNAL;
}
- log_debug(LD_CIRC,"Sending extend relay cell.");
+ log_info(LD_CIRC,"Sending extend relay cell.");
/* send it to hop->prev, because it will transfer
* it to a create cell and then send to hop */
if (relay_send_command_from_edge(0, TO_CIRCUIT(circ),
@@ -988,7 +988,8 @@ onionskin_answer(or_circuit_t *circ, uint8_t cell_type, const char *payload,
circ->is_first_hop = (cell_type == CELL_CREATED_FAST);
- connection_or_write_cell_to_buf(&cell, circ->p_conn);
+ append_cell_to_circuit_queue(TO_CIRCUIT(circ),
+ circ->p_conn, &cell, CELL_DIRECTION_IN);
log_debug(LD_CIRC,"Finished sending 'created' cell.");
if (!is_local_IP(circ->p_conn->_base.addr) &&