summaryrefslogtreecommitdiff
path: root/src/or/or.h
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-12-26 18:08:01 -0500
committerNick Mathewson <nickm@torproject.org>2013-01-03 13:03:41 -0500
commitb0b3c14c11afe55cd71f9c1b8a89d9e5a65c9799 (patch)
tree5c360b7f1aa0e77061676949bb1679fa4311190d /src/or/or.h
parentdffc8e359bcfeb00813a3afde6aa2328f6a6a476 (diff)
downloadtor-b0b3c14c11afe55cd71f9c1b8a89d9e5a65c9799.tar.gz
tor-b0b3c14c11afe55cd71f9c1b8a89d9e5a65c9799.zip
Eliminate MaxOnionsPending; replace it with MaxOnionQueueDelay
The right way to set "MaxOnionsPending" was to adjust it until the processing delay was appropriate. So instead, let's measure how long it takes to process onionskins (sampling them once we have a big number), and then limit the queue based on its expected time to finish. This change is extra-necessary for ntor, since there is no longer a reasonable way to set MaxOnionsPending without knowing what mix of onionskins you'll get. This patch also reserves 1/3 of the onionskin spots for ntor handshakes, on the theory that TAP handshakes shouldn't be allowed to starve their speedier cousins. We can change this later if need be. Resolves 7291.
Diffstat (limited to 'src/or/or.h')
-rw-r--r--src/or/or.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/or/or.h b/src/or/or.h
index 7b8ff705a4..7db5a52f34 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -2579,6 +2579,7 @@ struct ntor_handshake_state_t;
#define ONION_HANDSHAKE_TYPE_TAP 0x0000
#define ONION_HANDSHAKE_TYPE_FAST 0x0001
#define ONION_HANDSHAKE_TYPE_NTOR 0x0002
+#define MAX_ONION_HANDSHAKE_TYPE 0x0002
typedef struct {
uint16_t tag;
union {
@@ -3483,9 +3484,7 @@ typedef struct {
* and try a new circuit if the stream has been
* waiting for this many seconds. If zero, use
* our default internal timeout schedule. */
- int MaxOnionsPending; /**< How many circuit CREATE requests do we allow
- * to wait simultaneously before we start dropping
- * them? */
+ int MaxOnionQueueDelay; /**<DOCDOC*/
int NewCircuitPeriod; /**< How long do we use a circuit before building
* a new one? */
int MaxCircuitDirtiness; /**< Never use circs that were first used more than