diff options
author | Andrea Shepard <andrea@torproject.org> | 2013-06-13 20:41:00 -0700 |
---|---|---|
committer | Andrea Shepard <andrea@torproject.org> | 2013-06-13 21:39:04 -0700 |
commit | 4cce58d3c22c65350fffb3c4bc4dccd73e0193d7 (patch) | |
tree | 01764f77d0a2b27397ce91da3acc089493ef296c /src/or/or.h | |
parent | 4835faebf533f93eb390649dfcb5c8cc0289e3d3 (diff) | |
download | tor-4cce58d3c22c65350fffb3c4bc4dccd73e0193d7.tar.gz tor-4cce58d3c22c65350fffb3c4bc4dccd73e0193d7.zip |
Don't queue more cells as a middle relay than the spec allows to be in flight
Diffstat (limited to 'src/or/or.h')
-rw-r--r-- | src/or/or.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/or/or.h b/src/or/or.h index 6728b862b5..2565777c7b 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -539,6 +539,8 @@ typedef enum { #define CIRCUIT_PURPOSE_IS_ESTABLISHED_REND(p) \ ((p) == CIRCUIT_PURPOSE_C_REND_JOINED || \ (p) == CIRCUIT_PURPOSE_S_REND_JOINED) +/** True iff the circuit_t c is actually an or_circuit_t */ +#define CIRCUIT_IS_ORCIRC(c) (((circuit_t *)(c))->magic == OR_CIRCUIT_MAGIC) /** How many circuits do we want simultaneously in-progress to handle * a given stream? */ @@ -814,6 +816,12 @@ typedef enum { /** Amount to increment a stream window when we get a stream SENDME. */ #define STREAMWINDOW_INCREMENT 50 +/** Maximum number of queued cells on a circuit for which we are the + * midpoint before we give up and kill it. This must be >= circwindow + * to avoid killing innocent circuits. + */ +#define ORCIRC_MAX_MIDDLE_CELLS (11*(CIRCWINDOW_START_MAX)/10) + /* Cell commands. These values are defined in tor-spec.txt. */ #define CELL_PADDING 0 #define CELL_CREATE 1 |