aboutsummaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2006-06-07 09:18:53 +0000
committerRoger Dingledine <arma@torproject.org>2006-06-07 09:18:53 +0000
commit91bd12c20df2c24d4248f244dbebb2bedee76599 (patch)
treee48343180e7f4e7c79cd7a91e118c41ba1be56d7 /src/or/or.h
parent741b11df454f4c7d77aacf58f05ee9a6af884474 (diff)
downloadtor-91bd12c20df2c24d4248f244dbebb2bedee76599.tar
tor-91bd12c20df2c24d4248f244dbebb2bedee76599.tar.gz
re-enable per-connection rate limiting. get rid of the "OP bandwidth"
concept. lay groundwork for "bandwidth classes" -- separate global buckets that apply depending on what sort of conn it is. svn:r6563
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/or/or.h b/src/or/or.h
index d7a0e1361..79ce0b274 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -149,7 +149,6 @@
#define cell_t tor_cell_t
#endif
-#define DEFAULT_BANDWIDTH_OP (1024 * 1000)
#define MAX_NICKNAME_LEN 19
/* Hex digest plus dollar sign. */
#define MAX_HEX_NICKNAME_LEN (HEX_DIGEST_LEN+1)
@@ -666,11 +665,12 @@ struct connection_t {
/* Used only by OR connections: */
tor_tls_t *tls; /**< TLS connection state (OR only.) */
- /* bandwidth and receiver_bucket only used by ORs in OPEN state: */
- int bandwidth; /**< Connection bandwidth. (OPEN ORs only.) */
+ /* bandwidth* and receiver_bucket only used by ORs in OPEN state: */
+ int bandwidthrate; /**< Bytes/s added to the bucket. (OPEN ORs only.) */
+ int bandwidthburst; /**< Max bucket size for this conn. (OPEN ORs only.) */
int receiver_bucket; /**< When this hits 0, stop receiving. Every second we
- * add 'bandwidth' to this, capping it at 10*bandwidth.
- * (OPEN ORs only)
+ * add 'bandwidthrate' to this, capping it at
+ * bandwidthburst. (OPEN ORs only)
*/
circ_id_type_t circ_id_type; /**< When we send CREATE cells along this
* connection, which half of the space should
@@ -1320,6 +1320,10 @@ typedef struct {
* to use in a second? */
uint64_t MaxAdvertisedBandwidth; /**< How much bandwidth are we willing to
* tell people we have? */
+ uint64_t RelayBandwidthRate; /**< How much bandwidth, on average, are we
+ * willing to use for all relayed conns? */
+ uint64_t RelayBandwidthBurst; /**< How much bandwidth, at maximum, will we
+ * use in a second for all relayed conns? */
int NumCpus; /**< How many CPUs should we try to use? */
int RunTesting; /**< If true, create testing circuits to measure how well the
* other ORs are running. */