oh, and make it compile

still need to make a decision about per-connection rate limiting
(take it out? update it?)


svn:r984
This commit is contained in:
Roger Dingledine 2004-01-11 07:41:01 +00:00
parent 1a137c266a
commit b669b1d57c
3 changed files with 7 additions and 6 deletions

View File

@ -76,7 +76,7 @@ int connection_or_finished_flushing(connection_t *conn) {
void connection_or_init_conn_from_router(connection_t *conn, routerinfo_t *router) {
conn->addr = router->addr;
conn->port = router->or_port;
conn->receiver_bucket = conn->bandwidth = router->bandwidth;
conn->receiver_bucket = conn->bandwidth = router->bandwidthburst;
conn->onion_pkey = crypto_pk_dup_key(router->onion_pkey);
conn->link_pkey = crypto_pk_dup_key(router->link_pkey);
conn->identity_pkey = crypto_pk_dup_key(router->identity_pkey);

View File

@ -752,9 +752,9 @@ routerinfo_t *router_get_entry_from_string(const char**s) {
router->bandwidthburst = 10*router->bandwidthrate;
#endif
log_fn(LOG_DEBUG,"or_port %d, socks_port %d, dir_port %d, bandwidth %u.",
log_fn(LOG_DEBUG,"or_port %d, socks_port %d, dir_port %d, bandwidthrate %u, bandwidthburst %u.",
router->or_port, router->socks_port, router->dir_port,
(unsigned) router->bandwidth);
(unsigned) router->bandwidthrate, (unsigned) router->bandwidthburst);
/* XXX Later, require platform before published. */
NEXT_TOKEN();

View File

@ -554,7 +554,7 @@ test_dir_format()
r1.onion_pkey = pk1;
r1.identity_pkey = pk2;
r1.link_pkey = pk3;
r1.bandwidth = 1000;
r1.bandwidthrate = r1.bandwidthburst = 1000;
r1.exit_policy = NULL;
r1.nickname = "Magri";
@ -578,7 +578,7 @@ test_dir_format()
r2.onion_pkey = pk2;
r2.identity_pkey = pk1;
r2.link_pkey = pk2;
r2.bandwidth = 3000;
r2.bandwidthrate = r2.bandwidthburst = 3000;
r2.exit_policy = &ex1;
test_assert(!crypto_pk_write_public_key_to_string(pk1, &pk1_str,
@ -615,7 +615,8 @@ test_dir_format()
test_eq(rp1->or_port, r1.or_port);
test_eq(rp1->socks_port, r1.socks_port);
test_eq(rp1->dir_port, r1.dir_port);
test_eq(rp1->bandwidth, r1.bandwidth);
test_eq(rp1->bandwidthrate, r1.bandwidthrate);
// test_eq(rp1->bandwidthburst, r1.bandwidthburst);
test_assert(crypto_pk_cmp_keys(rp1->onion_pkey, pk1) == 0);
test_assert(crypto_pk_cmp_keys(rp1->link_pkey, pk3) == 0);
test_assert(crypto_pk_cmp_keys(rp1->identity_pkey, pk2) == 0);