mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
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
This commit is contained in:
parent
90b53beec5
commit
e00a1cbf16
@ -23,6 +23,8 @@ Changes in version 0.1.2.8-alpha - 2007-??-??
|
|||||||
- Warn the user when an application uses the obsolete binary v0 control
|
- Warn the user when an application uses the obsolete binary v0 control
|
||||||
protocol. We're planning to remove support for it during the next
|
protocol. We're planning to remove support for it during the next
|
||||||
development series, so it's good to give people some advance warning.
|
development series, so it's good to give people some advance warning.
|
||||||
|
- Remove some never-implemented options. Mark PathlenCoinWeight as
|
||||||
|
obsolete.
|
||||||
|
|
||||||
|
|
||||||
Changes in version 0.1.2.7-alpha - 2007-02-06
|
Changes in version 0.1.2.7-alpha - 2007-02-06
|
||||||
|
@ -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.
|
* is feasible, except if it's less than 2, in which case return -1.
|
||||||
*/
|
*/
|
||||||
static int
|
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)
|
smartlist_t *routers)
|
||||||
{
|
{
|
||||||
int num_acceptable_routers;
|
int num_acceptable_routers;
|
||||||
int routelen;
|
int routelen;
|
||||||
|
|
||||||
tor_assert(cw >= 0.);
|
|
||||||
tor_assert(cw < 1.);
|
|
||||||
tor_assert(routers);
|
tor_assert(routers);
|
||||||
|
|
||||||
#ifdef TOR_PERF
|
#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.");
|
log_debug(LD_CIRC, "Launching a one-hop circuit for dir tunnel.");
|
||||||
state->desired_path_len = 1;
|
state->desired_path_len = 1;
|
||||||
} else {
|
} else {
|
||||||
int r = new_route_len(get_options()->PathlenCoinWeight,
|
int r = new_route_len(circ->_base.purpose, exit, rl->routers);
|
||||||
circ->_base.purpose, exit, rl->routers);
|
|
||||||
if (r < 1) /* must be at least 1 */
|
if (r < 1) /* must be at least 1 */
|
||||||
return -1;
|
return -1;
|
||||||
state->desired_path_len = r;
|
state->desired_path_len = r;
|
||||||
|
@ -207,8 +207,7 @@ static config_var_t _option_vars[] = {
|
|||||||
VAR("ORListenAddress", LINELIST, ORListenAddress, NULL),
|
VAR("ORListenAddress", LINELIST, ORListenAddress, NULL),
|
||||||
VAR("ORPort", UINT, ORPort, "0"),
|
VAR("ORPort", UINT, ORPort, "0"),
|
||||||
VAR("OutboundBindAddress", STRING, OutboundBindAddress, NULL),
|
VAR("OutboundBindAddress", STRING, OutboundBindAddress, NULL),
|
||||||
/* XXXX012 mark this obsolete? Warn if it's set? */
|
OBSOLETE("PathlenCoinWeight"),
|
||||||
VAR("PathlenCoinWeight", DOUBLE, PathlenCoinWeight, "0.3"),
|
|
||||||
VAR("PidFile", STRING, PidFile, NULL),
|
VAR("PidFile", STRING, PidFile, NULL),
|
||||||
VAR("PreferTunneledDirConns", BOOL, PreferTunneledDirConns, "0"),
|
VAR("PreferTunneledDirConns", BOOL, PreferTunneledDirConns, "0"),
|
||||||
VAR("ProtocolWarnings", BOOL, ProtocolWarnings, "0"),
|
VAR("ProtocolWarnings", BOOL, ProtocolWarnings, "0"),
|
||||||
@ -221,9 +220,6 @@ static config_var_t _option_vars[] = {
|
|||||||
VAR("RecommendedClientVersions", LINELIST, RecommendedClientVersions, NULL),
|
VAR("RecommendedClientVersions", LINELIST, RecommendedClientVersions, NULL),
|
||||||
VAR("RecommendedServerVersions", LINELIST, RecommendedServerVersions, NULL),
|
VAR("RecommendedServerVersions", LINELIST, RecommendedServerVersions, NULL),
|
||||||
VAR("RedirectExit", LINELIST, RedirectExit, 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("RendExcludeNodes", STRING, RendExcludeNodes, NULL),
|
||||||
VAR("RendNodes", STRING, RendNodes, NULL),
|
VAR("RendNodes", STRING, RendNodes, NULL),
|
||||||
VAR("RendPostPeriod", INTERVAL, RendPostPeriod, "1 hour"),
|
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 &&
|
if (options->SocksPort >= 1 &&
|
||||||
(options->PathlenCoinWeight < 0.0 || options->PathlenCoinWeight >= 1.0))
|
(options->PathlenCoinWeight < 0.0 || options->PathlenCoinWeight >= 1.0))
|
||||||
REJECT("PathlenCoinWeight option must be >=0.0 and <1.0.");
|
REJECT("PathlenCoinWeight option must be >=0.0 and <1.0.");
|
||||||
|
#endif
|
||||||
|
|
||||||
if (options->RendPostPeriod < MIN_REND_POST_PERIOD) {
|
if (options->RendPostPeriod < MIN_REND_POST_PERIOD) {
|
||||||
log(LOG_WARN,LD_CONFIG,"RendPostPeriod option must be at least %d seconds."
|
log(LOG_WARN,LD_CONFIG,"RendPostPeriod option must be at least %d seconds."
|
||||||
|
@ -477,9 +477,8 @@ connection_about_to_close_connection(connection_t *conn)
|
|||||||
conn->marked_for_close_file, conn->marked_for_close);
|
conn->marked_for_close_file, conn->marked_for_close);
|
||||||
}
|
}
|
||||||
if (!edge_conn->end_reason) {
|
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"
|
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);
|
conn->marked_for_close_file, conn->marked_for_close);
|
||||||
}
|
}
|
||||||
control_event_stream_status(edge_conn, STREAM_EVENT_CLOSED,
|
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)
|
if (conn->hold_open_until_flushed)
|
||||||
tor_assert(conn->marked_for_close);
|
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. */
|
* marked_for_close. */
|
||||||
|
|
||||||
/* buffers */
|
/* buffers */
|
||||||
@ -2394,7 +2393,7 @@ assert_connection_ok(connection_t *conn, time_t now)
|
|||||||
assert_buf_ok(conn->outbuf);
|
assert_buf_ok(conn->outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXXX012 Fix this; no longer so.*/
|
/* XXXX Fix this; no longer so.*/
|
||||||
#if 0
|
#if 0
|
||||||
if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)
|
if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)
|
||||||
tor_assert(!conn->pkey);
|
tor_assert(!conn->pkey);
|
||||||
|
23
src/or/dns.c
23
src/or/dns.c
@ -320,20 +320,12 @@ void
|
|||||||
dns_free_all(void)
|
dns_free_all(void)
|
||||||
{
|
{
|
||||||
cached_resolve_t **ptr, **next, *item;
|
cached_resolve_t **ptr, **next, *item;
|
||||||
|
assert_cache_ok();
|
||||||
if (cached_resolve_pqueue) {
|
if (cached_resolve_pqueue) {
|
||||||
SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res,
|
SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res,
|
||||||
{
|
{
|
||||||
/* XXXX012 The hash lookups here could be quite slow; remove them
|
if (res->state == CACHE_STATE_DONE)
|
||||||
* 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);
|
|
||||||
_free_cached_resolve(res);
|
_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) {
|
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,
|
smartlist_pqueue_assert_ok(cached_resolve_pqueue,
|
||||||
_compare_cached_resolves_by_expiry);
|
_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
|
#endif
|
||||||
|
|
||||||
|
@ -1610,8 +1610,6 @@ typedef struct {
|
|||||||
int DirAllowPrivateAddresses;
|
int DirAllowPrivateAddresses;
|
||||||
char *User; /**< Name of user to run Tor as. */
|
char *User; /**< Name of user to run Tor as. */
|
||||||
char *Group; /**< Name of group 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 ORPort; /**< Port to listen on for OR connections. */
|
||||||
int SocksPort; /**< Port to listen on for SOCKS connections. */
|
int SocksPort; /**< Port to listen on for SOCKS connections. */
|
||||||
/** Port to listen on for transparent pf/netfilter connections. */
|
/** Port to listen on for transparent pf/netfilter connections. */
|
||||||
@ -1683,10 +1681,6 @@ typedef struct {
|
|||||||
* to use in a second? */
|
* to use in a second? */
|
||||||
uint64_t MaxAdvertisedBandwidth; /**< How much bandwidth are we willing to
|
uint64_t MaxAdvertisedBandwidth; /**< How much bandwidth are we willing to
|
||||||
* tell people we have? */
|
* 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 NumCpus; /**< How many CPUs should we try to use? */
|
||||||
int RunTesting; /**< If true, create testing circuits to measure how well the
|
int RunTesting; /**< If true, create testing circuits to measure how well the
|
||||||
* other ORs are running. */
|
* other ORs are running. */
|
||||||
|
Loading…
Reference in New Issue
Block a user