diff options
author | Nick Mathewson <nickm@torproject.org> | 2007-02-08 22:07:56 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2007-02-08 22:07:56 +0000 |
commit | e00a1cbf16d04f8c66320e599ae383753f590f09 (patch) | |
tree | ccece7691f4b9ca02e91d723bea266800177f00c /src | |
parent | 90b53beec5ba4ea19f144c17a5bbe7936e0c49c5 (diff) | |
download | tor-e00a1cbf16d04f8c66320e599ae383753f590f09.tar tor-e00a1cbf16d04f8c66320e599ae383753f590f09.tar.gz |
r11726@catbus: nickm | 2007-02-08 16:04:53 -0500
Resolve some XXXX012 items:
- Remove PathlenCoinWeight: if we want it again, we can add it
back in.
- Ditto with RelayBandwidth*.
- Decide to leave in the "hey, you didn't set end_reason!" BUG log message,
but stop telling people to bug me personally.
- Postpone strengthening assert_connection_ok(): it's important, but
it's also a good way to introduce weird bugs.
- Move some expensive consistency checking from dns_free_all() into
assert_cache_ok().
svn:r9533
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitbuild.c | 7 | ||||
-rw-r--r-- | src/or/config.c | 8 | ||||
-rw-r--r-- | src/or/connection.c | 7 | ||||
-rw-r--r-- | src/or/dns.c | 23 | ||||
-rw-r--r-- | src/or/or.h | 6 |
5 files changed, 21 insertions, 30 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 521302a37..6f3736b9a 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -998,14 +998,12 @@ onionskin_answer(or_circuit_t *circ, uint8_t cell_type, const char *payload, * is feasible, except if it's less than 2, in which case return -1. */ static int -new_route_len(double cw, uint8_t purpose, extend_info_t *exit, +new_route_len(uint8_t purpose, extend_info_t *exit, smartlist_t *routers) { int num_acceptable_routers; int routelen; - tor_assert(cw >= 0.); - tor_assert(cw < 1.); tor_assert(routers); #ifdef TOR_PERF @@ -1354,8 +1352,7 @@ onion_pick_cpath_exit(origin_circuit_t *circ, extend_info_t *exit) log_debug(LD_CIRC, "Launching a one-hop circuit for dir tunnel."); state->desired_path_len = 1; } else { - int r = new_route_len(get_options()->PathlenCoinWeight, - circ->_base.purpose, exit, rl->routers); + int r = new_route_len(circ->_base.purpose, exit, rl->routers); if (r < 1) /* must be at least 1 */ return -1; state->desired_path_len = r; diff --git a/src/or/config.c b/src/or/config.c index 962752cf0..0d4832540 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -207,8 +207,7 @@ static config_var_t _option_vars[] = { VAR("ORListenAddress", LINELIST, ORListenAddress, NULL), VAR("ORPort", UINT, ORPort, "0"), VAR("OutboundBindAddress", STRING, OutboundBindAddress, NULL), - /* XXXX012 mark this obsolete? Warn if it's set? */ - VAR("PathlenCoinWeight", DOUBLE, PathlenCoinWeight, "0.3"), + OBSOLETE("PathlenCoinWeight"), VAR("PidFile", STRING, PidFile, NULL), VAR("PreferTunneledDirConns", BOOL, PreferTunneledDirConns, "0"), VAR("ProtocolWarnings", BOOL, ProtocolWarnings, "0"), @@ -221,9 +220,6 @@ static config_var_t _option_vars[] = { VAR("RecommendedClientVersions", LINELIST, RecommendedClientVersions, NULL), VAR("RecommendedServerVersions", LINELIST, RecommendedServerVersions, NULL), VAR("RedirectExit", LINELIST, RedirectExit, NULL), - /* XXXX012 These aren't implemented. Take them out for now? */ - VAR("RelayBandwidthBurst", MEMUNIT, RelayBandwidthBurst, "0"), - VAR("RelayBandwidthRate", MEMUNIT, RelayBandwidthRate, "0"), VAR("RendExcludeNodes", STRING, RendExcludeNodes, NULL), VAR("RendNodes", STRING, RendNodes, NULL), VAR("RendPostPeriod", INTERVAL, RendPostPeriod, "1 hour"), @@ -2611,9 +2607,11 @@ options_validate(or_options_t *old_options, or_options_t *options, }); } +#if 0 if (options->SocksPort >= 1 && (options->PathlenCoinWeight < 0.0 || options->PathlenCoinWeight >= 1.0)) REJECT("PathlenCoinWeight option must be >=0.0 and <1.0."); +#endif if (options->RendPostPeriod < MIN_REND_POST_PERIOD) { log(LOG_WARN,LD_CONFIG,"RendPostPeriod option must be at least %d seconds." diff --git a/src/or/connection.c b/src/or/connection.c index 8dcee806e..5edb5b657 100644 --- a/src/or/connection.c +++ b/src/or/connection.c @@ -477,9 +477,8 @@ connection_about_to_close_connection(connection_t *conn) conn->marked_for_close_file, conn->marked_for_close); } if (!edge_conn->end_reason) { - // XXXX012 Disable this before 0.1.2.x-final ships. log_warn(LD_BUG,"Bug: Closing stream (marked at %s:%d) without having" - " set end_reason. Please tell Nick.", + " set end_reason.", conn->marked_for_close_file, conn->marked_for_close); } control_event_stream_status(edge_conn, STREAM_EVENT_CLOSED, @@ -2385,7 +2384,7 @@ assert_connection_ok(connection_t *conn, time_t now) if (conn->hold_open_until_flushed) tor_assert(conn->marked_for_close); - /* XXXX012 check: wants_to_read, wants_to_write, s, conn_array_index, + /* XXXX check: wants_to_read, wants_to_write, s, conn_array_index, * marked_for_close. */ /* buffers */ @@ -2394,7 +2393,7 @@ assert_connection_ok(connection_t *conn, time_t now) assert_buf_ok(conn->outbuf); } - /* XXXX012 Fix this; no longer so.*/ + /* XXXX Fix this; no longer so.*/ #if 0 if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR) tor_assert(!conn->pkey); diff --git a/src/or/dns.c b/src/or/dns.c index e95ce3273..26cc1ede6 100644 --- a/src/or/dns.c +++ b/src/or/dns.c @@ -320,20 +320,12 @@ void dns_free_all(void) { cached_resolve_t **ptr, **next, *item; + assert_cache_ok(); if (cached_resolve_pqueue) { SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res, { - /* XXXX012 The hash lookups here could be quite slow; remove them - * once we're happy. (Leave them in for at least 0.1.2.7-alpha, so they - * get some testing.) -NM */ - if (res->state == CACHE_STATE_DONE) { - cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res); - tor_assert(!found || found != res); + if (res->state == CACHE_STATE_DONE) _free_cached_resolve(res); - } else { - cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res); - tor_assert(found); - } }); } for (ptr = HT_START(cache_map, &cache_root); ptr != NULL; ptr = next) { @@ -2032,6 +2024,17 @@ _assert_cache_ok(void) smartlist_pqueue_assert_ok(cached_resolve_pqueue, _compare_cached_resolves_by_expiry); + + SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res, + { + if (res->state == CACHE_STATE_DONE) { + cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res); + tor_assert(!found || found != res); + } else { + cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res); + tor_assert(found); + } + }); } #endif diff --git a/src/or/or.h b/src/or/or.h index 96f12dc87..0f529d56f 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -1610,8 +1610,6 @@ typedef struct { int DirAllowPrivateAddresses; char *User; /**< Name of user to run Tor as. */ char *Group; /**< Name of group to run Tor as. */ - double PathlenCoinWeight; /**< Parameter used to configure average path - * length (alpha in geometric distribution). */ int ORPort; /**< Port to listen on for OR connections. */ int SocksPort; /**< Port to listen on for SOCKS connections. */ /** Port to listen on for transparent pf/netfilter connections. */ @@ -1683,10 +1681,6 @@ 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. */ |