aboutsummaryrefslogtreecommitdiff
path: root/src/or/connection.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-02-15 16:23:43 -0500
committerNick Mathewson <nickm@torproject.org>2013-02-15 16:23:43 -0500
commitd6634001c9063323643e3ddfe8905c250a6d60d7 (patch)
tree7efa13432f31719ec5b4446f4ed00d0d4d34cd51 /src/or/connection.c
parent5fcc5dfa779fcdc84cb7249749b7fbb782f15a10 (diff)
parent076654ce8423d2b8ab7285b22c13d4002942bd8b (diff)
downloadtor-d6634001c9063323643e3ddfe8905c250a6d60d7.tar.gz
tor-d6634001c9063323643e3ddfe8905c250a6d60d7.zip
Merge remote-tracking branch 'public/wide_circ_ids'
Conflicts: src/or/channel.h src/or/connection_or.c src/or/cpuworker.c
Diffstat (limited to 'src/or/connection.c')
-rw-r--r--src/or/connection.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index 737da72923..c659e65fe5 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -2223,8 +2223,7 @@ connection_bucket_round_robin(int base, int priority,
static ssize_t
connection_bucket_read_limit(connection_t *conn, time_t now)
{
- int base = connection_speaks_cells(conn) ?
- CELL_NETWORK_SIZE : RELAY_PAYLOAD_SIZE;
+ int base = RELAY_PAYLOAD_SIZE;
int priority = conn->type != CONN_TYPE_DIR;
int conn_bucket = -1;
int global_bucket = global_read_bucket;
@@ -2233,6 +2232,7 @@ connection_bucket_read_limit(connection_t *conn, time_t now)
or_connection_t *or_conn = TO_OR_CONN(conn);
if (conn->state == OR_CONN_STATE_OPEN)
conn_bucket = or_conn->read_bucket;
+ base = get_cell_network_size(or_conn->wide_circ_ids);
}
if (!connection_is_rate_limited(conn)) {
@@ -2252,8 +2252,7 @@ connection_bucket_read_limit(connection_t *conn, time_t now)
ssize_t
connection_bucket_write_limit(connection_t *conn, time_t now)
{
- int base = connection_speaks_cells(conn) ?
- CELL_NETWORK_SIZE : RELAY_PAYLOAD_SIZE;
+ int base = RELAY_PAYLOAD_SIZE;
int priority = conn->type != CONN_TYPE_DIR;
int conn_bucket = (int)conn->outbuf_flushlen;
int global_bucket = global_write_bucket;
@@ -2271,6 +2270,7 @@ connection_bucket_write_limit(connection_t *conn, time_t now)
if (or_conn->write_bucket < conn_bucket)
conn_bucket = or_conn->write_bucket >= 0 ?
or_conn->write_bucket : 0;
+ base = get_cell_network_size(or_conn->wide_circ_ids);
}
if (connection_counts_as_relayed_traffic(conn, now) &&