Commit 7f3f88be authored by Roger Dingledine's avatar Roger Dingledine
Browse files

New config option "CircuitStreamTimeout"

New config option "CircuitStreamTimeout" to override our internal
timeout schedule for how many seconds until we detach a stream from
a circuit and try a new circuit. If your network is particularly
slow, you might want to set this to a number like 60.
parent fdd58f3b
Changes in version 0.2.2.7-alpha - 2009-??-?? Changes in version 0.2.2.7-alpha - 2009-??-??
o Minor features:
- New config option "CircuitStreamTimeout" to override our internal
timeout schedule for how many seconds until we detach a stream from
a circuit and try a new circuit. If your network is particularly
slow, you might want to set this to a number like 60.
o Minor bugfixes: o Minor bugfixes:
- Fix compilation on OSX 10.3, which has a stub mlockall() but - Fix compilation on OSX 10.3, which has a stub mlockall() but
hides it. Bugfix on 0.2.2.6-alpha. hides it. Bugfix on 0.2.2.6-alpha.
......
...@@ -166,6 +166,7 @@ static config_var_t _option_vars[] = { ...@@ -166,6 +166,7 @@ static config_var_t _option_vars[] = {
V(CellStatistics, BOOL, "0"), V(CellStatistics, BOOL, "0"),
V(CircuitBuildTimeout, INTERVAL, "0"), V(CircuitBuildTimeout, INTERVAL, "0"),
V(CircuitIdleTimeout, INTERVAL, "1 hour"), V(CircuitIdleTimeout, INTERVAL, "1 hour"),
V(CircuitStreamTimeout, INTERVAL, "0"),
V(ClientDNSRejectInternalAddresses, BOOL,"1"), V(ClientDNSRejectInternalAddresses, BOOL,"1"),
V(ClientOnly, BOOL, "0"), V(ClientOnly, BOOL, "0"),
V(ConsensusParams, STRING, NULL), V(ConsensusParams, STRING, NULL),
......
...@@ -377,13 +377,16 @@ connection_edge_finished_connecting(edge_connection_t *edge_conn) ...@@ -377,13 +377,16 @@ connection_edge_finished_connecting(edge_connection_t *edge_conn)
static int static int
compute_retry_timeout(edge_connection_t *conn) compute_retry_timeout(edge_connection_t *conn)
{ {
int timeout = get_options()->CircuitStreamTimeout;
if (timeout) /* if our config options override the default, use them */
return timeout;
if (conn->num_socks_retries < 2) /* try 0 and try 1 */ if (conn->num_socks_retries < 2) /* try 0 and try 1 */
return 10; return 10;
return 15; return 15;
} }
/** Find all general-purpose AP streams waiting for a response that sent their /** Find all general-purpose AP streams waiting for a response that sent their
* begin/resolve cell >=15 seconds ago. Detach from their current circuit, and * begin/resolve cell too long ago. Detach from their current circuit, and
* mark their current circuit as unsuitable for new streams. Then call * mark their current circuit as unsuitable for new streams. Then call
* connection_ap_handshake_attach_circuit() to attach to a new circuit (if * connection_ap_handshake_attach_circuit() to attach to a new circuit (if
* available) or launch a new one. * available) or launch a new one.
......
...@@ -2445,10 +2445,15 @@ typedef struct { ...@@ -2445,10 +2445,15 @@ typedef struct {
* connections alive? */ * connections alive? */
int SocksTimeout; /**< How long do we let a socks connection wait int SocksTimeout; /**< How long do we let a socks connection wait
* unattached before we fail it? */ * unattached before we fail it? */
int CircuitBuildTimeout; /**< Cull non-open circuits that were born int CircuitBuildTimeout; /**< If non-zero, cull non-open circuits that
* at least this many seconds ago. */ * were born at least this many seconds ago. If
* zero, use the internal adaptive algorithm. */
int CircuitIdleTimeout; /**< Cull open clean circuits that were born int CircuitIdleTimeout; /**< Cull open clean circuits that were born
* at least this many seconds ago. */ * at least this many seconds ago. */
int CircuitStreamTimeout; /**< If non-zero, detach streams from circuits
* 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 int MaxOnionsPending; /**< How many circuit CREATE requests do we allow
* to wait simultaneously before we start dropping * to wait simultaneously before we start dropping
* them? */ * them? */
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment