summaryrefslogtreecommitdiff
path: root/src/or/circuit.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2002-07-18 06:37:58 +0000
committerRoger Dingledine <arma@torproject.org>2002-07-18 06:37:58 +0000
commit267434bdeac40a2ccc2677119ddc1925b80c0c4c (patch)
tree27ce149ec317584dddb923f8e7fd4544baf59d15 /src/or/circuit.c
parentccdef66b68a2f61dfe600fddafaf270537928fac (diff)
downloadtor-267434bdeac40a2ccc2677119ddc1925b80c0c4c.tar.gz
tor-267434bdeac40a2ccc2677119ddc1925b80c0c4c.zip
Implemented congestion control
Servers are allowed to send 100 cells initially, and can't send more until they receive a 'sendme' cell from that direction, indicating that they can send 10 more cells. As it currently stands, the exit node quickly runs out of window, and sends bursts of 10 whenever a sendme cell gets to him. This is much much much faster (and more flexible) than the old "give each circuit 1 kB/s and hope nothing overflows" approach. Also divided out the connection_watch_events into stop_reading, start_writing, etc. That way we can control them separately. svn:r54
Diffstat (limited to 'src/or/circuit.c')
-rw-r--r--src/or/circuit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/or/circuit.c b/src/or/circuit.c
index eeca48cbe9..c2c91338ca 100644
--- a/src/or/circuit.c
+++ b/src/or/circuit.c
@@ -57,6 +57,9 @@ circuit_t *circuit_new(aci_t p_aci, connection_t *p_conn) {
circ->p_aci = p_aci;
/* circ->n_aci remains 0 because we haven't identified the next hop yet */
+ circ->n_receive_window = RECEIVE_WINDOW_START;
+ circ->p_receive_window = RECEIVE_WINDOW_START;
+
circuit_add(circ);
return circ;