mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-28 14:23:30 +01:00
Triage the XXX022 and XXX021 comments remaining in the code
Remove some, postpone others, leave some alone. Now the only remaining XXX022s are ones that seem important to fix or investigate.
This commit is contained in:
parent
c4bd067359
commit
05887f10ff
@ -1087,7 +1087,7 @@ get_interface_address6(int severity, sa_family_t family, tor_addr_t *addr)
|
|||||||
|
|
||||||
/* ======
|
/* ======
|
||||||
* IPv4 helpers
|
* IPv4 helpers
|
||||||
* XXXX022 IPv6 deprecate some of these.
|
* XXXX023 IPv6 deprecate some of these.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** Return true iff <b>ip</b> (in host order) is an IP reserved to localhost,
|
/** Return true iff <b>ip</b> (in host order) is an IP reserved to localhost,
|
||||||
|
@ -666,12 +666,12 @@ read_to_chunk_tls(buf_t *buf, chunk_t *chunk, tor_tls_t *tls,
|
|||||||
* (because of EOF), set *<b>reached_eof</b> to 1 and return 0. Return -1 on
|
* (because of EOF), set *<b>reached_eof</b> to 1 and return 0. Return -1 on
|
||||||
* error; else return the number of bytes read.
|
* error; else return the number of bytes read.
|
||||||
*/
|
*/
|
||||||
/* XXXX021 indicate "read blocked" somehow? */
|
/* XXXX023 indicate "read blocked" somehow? */
|
||||||
int
|
int
|
||||||
read_to_buf(int s, size_t at_most, buf_t *buf, int *reached_eof,
|
read_to_buf(int s, size_t at_most, buf_t *buf, int *reached_eof,
|
||||||
int *socket_error)
|
int *socket_error)
|
||||||
{
|
{
|
||||||
/* XXXX021 It's stupid to overload the return values for these functions:
|
/* XXXX023 It's stupid to overload the return values for these functions:
|
||||||
* "error status" and "number of bytes read" are not mutually exclusive.
|
* "error status" and "number of bytes read" are not mutually exclusive.
|
||||||
*/
|
*/
|
||||||
int r = 0;
|
int r = 0;
|
||||||
@ -856,7 +856,7 @@ flush_chunk_tls(tor_tls_t *tls, buf_t *buf, chunk_t *chunk,
|
|||||||
int
|
int
|
||||||
flush_buf(int s, buf_t *buf, size_t sz, size_t *buf_flushlen)
|
flush_buf(int s, buf_t *buf, size_t sz, size_t *buf_flushlen)
|
||||||
{
|
{
|
||||||
/* XXXX021 It's stupid to overload the return values for these functions:
|
/* XXXX023 It's stupid to overload the return values for these functions:
|
||||||
* "error status" and "number of bytes flushed" are not mutually exclusive.
|
* "error status" and "number of bytes flushed" are not mutually exclusive.
|
||||||
*/
|
*/
|
||||||
int r;
|
int r;
|
||||||
|
@ -42,11 +42,12 @@
|
|||||||
|
|
||||||
/********* START VARIABLES **********/
|
/********* START VARIABLES **********/
|
||||||
/** Global list of circuit build times */
|
/** Global list of circuit build times */
|
||||||
// FIXME: Add this as a member for entry_guard_t instead of global?
|
// XXXX023: Add this as a member for entry_guard_t instead of global?
|
||||||
// Then we could do per-guard statistics, as guards are likely to
|
// Then we could do per-guard statistics, as guards are likely to
|
||||||
// vary in their own latency. The downside of this is that guards
|
// vary in their own latency. The downside of this is that guards
|
||||||
// can change frequently, so we'd be building a lot more circuits
|
// can change frequently, so we'd be building a lot more circuits
|
||||||
// most likely.
|
// most likely.
|
||||||
|
/* XXXX023 Make this static; add accessor functions. */
|
||||||
circuit_build_times_t circ_times;
|
circuit_build_times_t circ_times;
|
||||||
|
|
||||||
/** A global list of all circuits at this hop. */
|
/** A global list of all circuits at this hop. */
|
||||||
@ -3814,7 +3815,7 @@ entry_guards_compute_status(or_options_t *options, time_t now)
|
|||||||
* If <b>mark_relay_status</b>, also call router_set_status() on this
|
* If <b>mark_relay_status</b>, also call router_set_status() on this
|
||||||
* relay.
|
* relay.
|
||||||
*
|
*
|
||||||
* XXX022 change succeeded and mark_relay_status into 'int flags'.
|
* XXX023 change succeeded and mark_relay_status into 'int flags'.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
entry_guard_register_connect_status(const char *digest, int succeeded,
|
entry_guard_register_connect_status(const char *digest, int succeeded,
|
||||||
@ -3972,7 +3973,7 @@ entry_guards_prepend_from_config(or_options_t *options)
|
|||||||
|
|
||||||
/* Split entry guards into those on the list and those not. */
|
/* Split entry guards into those on the list and those not. */
|
||||||
|
|
||||||
/* XXXX022 Now that we allow countries and IP ranges in EntryNodes, this is
|
/* XXXX023 Now that we allow countries and IP ranges in EntryNodes, this is
|
||||||
* potentially an enormous list. For now, we disable such values for
|
* potentially an enormous list. For now, we disable such values for
|
||||||
* EntryNodes in options_validate(); really, this wants a better solution.
|
* EntryNodes in options_validate(); really, this wants a better solution.
|
||||||
* Perhaps we should do this calculation once whenever the list of routers
|
* Perhaps we should do this calculation once whenever the list of routers
|
||||||
@ -4304,7 +4305,7 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg)
|
|||||||
}
|
}
|
||||||
entry_guards = new_entry_guards;
|
entry_guards = new_entry_guards;
|
||||||
entry_guards_dirty = 0;
|
entry_guards_dirty = 0;
|
||||||
/* XXX022 hand new_entry_guards to this func, and move it up a
|
/* XXX023 hand new_entry_guards to this func, and move it up a
|
||||||
* few lines, so we don't have to re-dirty it */
|
* few lines, so we don't have to re-dirty it */
|
||||||
if (remove_obsolete_entry_guards(now))
|
if (remove_obsolete_entry_guards(now))
|
||||||
entry_guards_dirty = 1;
|
entry_guards_dirty = 1;
|
||||||
|
@ -1266,7 +1266,8 @@ circuit_get_open_circ_or_launch(edge_connection_t *conn,
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* XXXX022 Duplicates checks in connection_ap_handshake_attach_circuit */
|
/* XXXX023 Duplicates checks in connection_ap_handshake_attach_circuit:
|
||||||
|
* refactor into a single function? */
|
||||||
routerinfo_t *router = router_get_by_nickname(conn->chosen_exit_name, 1);
|
routerinfo_t *router = router_get_by_nickname(conn->chosen_exit_name, 1);
|
||||||
int opt = conn->chosen_exit_optional;
|
int opt = conn->chosen_exit_optional;
|
||||||
if (router && !connection_ap_can_use_exit(conn, router, 0)) {
|
if (router && !connection_ap_can_use_exit(conn, router, 0)) {
|
||||||
@ -1605,7 +1606,7 @@ connection_ap_handshake_attach_circuit(edge_connection_t *conn)
|
|||||||
/* find the circuit that we should use, if there is one. */
|
/* find the circuit that we should use, if there is one. */
|
||||||
retval = circuit_get_open_circ_or_launch(
|
retval = circuit_get_open_circ_or_launch(
|
||||||
conn, CIRCUIT_PURPOSE_C_GENERAL, &circ);
|
conn, CIRCUIT_PURPOSE_C_GENERAL, &circ);
|
||||||
if (retval < 1) // XXX021 if we totally fail, this still returns 0 -RD
|
if (retval < 1) // XXX022 if we totally fail, this still returns 0 -RD
|
||||||
return retval;
|
return retval;
|
||||||
|
|
||||||
log_debug(LD_APP|LD_CIRC,
|
log_debug(LD_APP|LD_CIRC,
|
||||||
|
@ -1338,7 +1338,7 @@ options_act(or_options_t *old_options)
|
|||||||
|| !geoip_is_loaded())) {
|
|| !geoip_is_loaded())) {
|
||||||
/* XXXX Don't use this "<default>" junk; make our filename options
|
/* XXXX Don't use this "<default>" junk; make our filename options
|
||||||
* understand prefixes somehow. -NM */
|
* understand prefixes somehow. -NM */
|
||||||
/* XXXX021 Reload GeoIPFile on SIGHUP. -NM */
|
/* XXXX023 Reload GeoIPFile on SIGHUP. -NM */
|
||||||
char *actual_fname = tor_strdup(options->GeoIPFile);
|
char *actual_fname = tor_strdup(options->GeoIPFile);
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
if (!strcmp(actual_fname, "<default>")) {
|
if (!strcmp(actual_fname, "<default>")) {
|
||||||
@ -2483,7 +2483,7 @@ is_local_addr(const tor_addr_t *addr)
|
|||||||
if (get_options()->EnforceDistinctSubnets == 0)
|
if (get_options()->EnforceDistinctSubnets == 0)
|
||||||
return 0;
|
return 0;
|
||||||
if (tor_addr_family(addr) == AF_INET) {
|
if (tor_addr_family(addr) == AF_INET) {
|
||||||
/*XXXX022 IP6 what corresponds to an /24? */
|
/*XXXX023 IP6 what corresponds to an /24? */
|
||||||
uint32_t ip = tor_addr_to_ipv4h(addr);
|
uint32_t ip = tor_addr_to_ipv4h(addr);
|
||||||
|
|
||||||
/* It's possible that this next check will hit before the first time
|
/* It's possible that this next check will hit before the first time
|
||||||
@ -3652,7 +3652,7 @@ options_validate(or_options_t *old_options, or_options_t *options,
|
|||||||
"ignore you.");
|
"ignore you.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*XXXX022 checking for defaults manually like this is a bit fragile.*/
|
/*XXXX023 checking for defaults manually like this is a bit fragile.*/
|
||||||
|
|
||||||
/* Keep changes to hard-coded values synchronous to man page and default
|
/* Keep changes to hard-coded values synchronous to man page and default
|
||||||
* values table. */
|
* values table. */
|
||||||
|
@ -2575,13 +2575,13 @@ connection_read_to_buf(connection_t *conn, int *max_to_read, int *socket_error)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (n_read > 0) { /* change *max_to_read */
|
if (n_read > 0) { /* change *max_to_read */
|
||||||
/*XXXX021 check for overflow*/
|
/*XXXX022 check for overflow*/
|
||||||
*max_to_read = (int)(at_most - n_read);
|
*max_to_read = (int)(at_most - n_read);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (conn->type == CONN_TYPE_AP) {
|
if (conn->type == CONN_TYPE_AP) {
|
||||||
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
|
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
|
||||||
/*XXXX021 check for overflow*/
|
/*XXXX022 check for overflow*/
|
||||||
edge_conn->n_read += (int)n_read;
|
edge_conn->n_read += (int)n_read;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2783,7 +2783,7 @@ connection_handle_write_impl(connection_t *conn, int force)
|
|||||||
|
|
||||||
if (conn->type == CONN_TYPE_AP) {
|
if (conn->type == CONN_TYPE_AP) {
|
||||||
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
|
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
|
||||||
/*XXXX021 check for overflow.*/
|
/*XXXX022 check for overflow.*/
|
||||||
edge_conn->n_written += (int)n_written;
|
edge_conn->n_written += (int)n_written;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -557,7 +557,7 @@ connection_ap_attach_pending(void)
|
|||||||
|
|
||||||
/** Tell any AP streams that are waiting for a one-hop tunnel to
|
/** Tell any AP streams that are waiting for a one-hop tunnel to
|
||||||
* <b>failed_digest</b> that they are going to fail. */
|
* <b>failed_digest</b> that they are going to fail. */
|
||||||
/* XXX022 We should get rid of this function, and instead attach
|
/* XXX023 We should get rid of this function, and instead attach
|
||||||
* one-hop streams to circ->p_streams so they get marked in
|
* one-hop streams to circ->p_streams so they get marked in
|
||||||
* circuit_mark_for_close like normal p_streams. */
|
* circuit_mark_for_close like normal p_streams. */
|
||||||
void
|
void
|
||||||
@ -2382,7 +2382,7 @@ tell_controller_about_resolved_result(edge_connection_t *conn,
|
|||||||
* certain errors or for values that didn't come via DNS. <b>expires</b> is
|
* certain errors or for values that didn't come via DNS. <b>expires</b> is
|
||||||
* a time when the answer expires, or -1 or TIME_MAX if there's a good TTL.
|
* a time when the answer expires, or -1 or TIME_MAX if there's a good TTL.
|
||||||
**/
|
**/
|
||||||
/* XXXX022 the use of the ttl and expires fields is nutty. Let's make this
|
/* XXXX023 the use of the ttl and expires fields is nutty. Let's make this
|
||||||
* interface and those that use it less ugly. */
|
* interface and those that use it less ugly. */
|
||||||
void
|
void
|
||||||
connection_ap_handshake_socks_resolved(edge_connection_t *conn,
|
connection_ap_handshake_socks_resolved(edge_connection_t *conn,
|
||||||
@ -2824,7 +2824,7 @@ connection_exit_connect(edge_connection_t *edge_conn)
|
|||||||
log_debug(LD_EXIT,"about to try connecting");
|
log_debug(LD_EXIT,"about to try connecting");
|
||||||
switch (connection_connect(conn, conn->address, addr, port, &socket_error)) {
|
switch (connection_connect(conn, conn->address, addr, port, &socket_error)) {
|
||||||
case -1:
|
case -1:
|
||||||
/* XXX021 use socket_error below rather than trying to piece things
|
/* XXX022 use socket_error below rather than trying to piece things
|
||||||
* together from the current errno, which may have been clobbered. */
|
* together from the current errno, which may have been clobbered. */
|
||||||
connection_edge_end_errno(edge_conn);
|
connection_edge_end_errno(edge_conn);
|
||||||
circuit_detach_stream(circuit_get_by_edge_conn(edge_conn), edge_conn);
|
circuit_detach_stream(circuit_get_by_edge_conn(edge_conn), edge_conn);
|
||||||
|
@ -372,7 +372,7 @@ directory_get_from_dirserver(uint8_t dir_purpose, uint8_t router_purpose,
|
|||||||
if (!get_via_tor) {
|
if (!get_via_tor) {
|
||||||
if (options->UseBridges && type != BRIDGE_AUTHORITY) {
|
if (options->UseBridges && type != BRIDGE_AUTHORITY) {
|
||||||
/* want to ask a running bridge for which we have a descriptor. */
|
/* want to ask a running bridge for which we have a descriptor. */
|
||||||
/* XXX022 we assume that all of our bridges can answer any
|
/* XXX023 we assume that all of our bridges can answer any
|
||||||
* possible directory question. This won't be true forever. -RD */
|
* possible directory question. This won't be true forever. -RD */
|
||||||
/* It certainly is not true with conditional consensus downloading,
|
/* It certainly is not true with conditional consensus downloading,
|
||||||
* so, for now, never assume the server supports that. */
|
* so, for now, never assume the server supports that. */
|
||||||
@ -1876,7 +1876,7 @@ connection_dir_client_reached_eof(dir_connection_t *conn)
|
|||||||
ds->nickname);
|
ds->nickname);
|
||||||
/* XXXX use this information; be sure to upload next one
|
/* XXXX use this information; be sure to upload next one
|
||||||
* sooner. -NM */
|
* sooner. -NM */
|
||||||
/* XXXX021 On further thought, the task above implies that we're
|
/* XXXX023 On further thought, the task above implies that we're
|
||||||
* basing our regenerate-descriptor time on when we uploaded the
|
* basing our regenerate-descriptor time on when we uploaded the
|
||||||
* last descriptor, not on the published time of the last
|
* last descriptor, not on the published time of the last
|
||||||
* descriptor. If those are different, that's a bad thing to
|
* descriptor. If those are different, that's a bad thing to
|
||||||
@ -2706,7 +2706,7 @@ directory_handle_command_get(dir_connection_t *conn, const char *headers,
|
|||||||
ssize_t estimated_len = 0;
|
ssize_t estimated_len = 0;
|
||||||
smartlist_t *items = smartlist_create();
|
smartlist_t *items = smartlist_create();
|
||||||
smartlist_t *dir_items = smartlist_create();
|
smartlist_t *dir_items = smartlist_create();
|
||||||
int lifetime = 60; /* XXXX022 should actually use vote intervals. */
|
int lifetime = 60; /* XXXX023 should actually use vote intervals. */
|
||||||
url += strlen("/tor/status-vote/");
|
url += strlen("/tor/status-vote/");
|
||||||
current = !strcmpstart(url, "current/");
|
current = !strcmpstart(url, "current/");
|
||||||
url = strchr(url, '/');
|
url = strchr(url, '/');
|
||||||
|
@ -946,7 +946,7 @@ running_long_enough_to_decide_unreachable(void)
|
|||||||
void
|
void
|
||||||
dirserv_set_router_is_running(routerinfo_t *router, time_t now)
|
dirserv_set_router_is_running(routerinfo_t *router, time_t now)
|
||||||
{
|
{
|
||||||
/*XXXX022 This function is a mess. Separate out the part that calculates
|
/*XXXX023 This function is a mess. Separate out the part that calculates
|
||||||
whether it's reachable and the part that tells rephist that the router was
|
whether it's reachable and the part that tells rephist that the router was
|
||||||
unreachable.
|
unreachable.
|
||||||
*/
|
*/
|
||||||
@ -1754,9 +1754,12 @@ dirserv_thinks_router_is_unreliable(time_t now,
|
|||||||
{
|
{
|
||||||
if (need_uptime) {
|
if (need_uptime) {
|
||||||
if (!enough_mtbf_info) {
|
if (!enough_mtbf_info) {
|
||||||
/* XXX022 Once most authorities are on v3, we should change the rule from
|
/* XXX023 Once most authorities are on v3, we should change the rule from
|
||||||
* "use uptime if we don't have mtbf data" to "don't advertise Stable on
|
* "use uptime if we don't have mtbf data" to "don't advertise Stable on
|
||||||
* v3 if we don't have enough mtbf data." */
|
* v3 if we don't have enough mtbf data." Or maybe not, since if we ever
|
||||||
|
* hit a point where we need to reset a lot of authorities at once,
|
||||||
|
* none of them would be in a position to declare Stable.
|
||||||
|
*/
|
||||||
long uptime = real_uptime(router, now);
|
long uptime = real_uptime(router, now);
|
||||||
if ((unsigned)uptime < stable_uptime &&
|
if ((unsigned)uptime < stable_uptime &&
|
||||||
(unsigned)uptime < UPTIME_TO_GUARANTEE_STABLE)
|
(unsigned)uptime < UPTIME_TO_GUARANTEE_STABLE)
|
||||||
@ -3260,7 +3263,7 @@ lookup_cached_dir_by_fp(const char *fp)
|
|||||||
d = strmap_get(cached_consensuses, "ns");
|
d = strmap_get(cached_consensuses, "ns");
|
||||||
else if (memchr(fp, '\0', DIGEST_LEN) && cached_consensuses &&
|
else if (memchr(fp, '\0', DIGEST_LEN) && cached_consensuses &&
|
||||||
(d = strmap_get(cached_consensuses, fp))) {
|
(d = strmap_get(cached_consensuses, fp))) {
|
||||||
/* this here interface is a nasty hack XXXX022 */;
|
/* this here interface is a nasty hack XXXX023 */;
|
||||||
} else if (router_digest_is_me(fp) && the_v2_networkstatus)
|
} else if (router_digest_is_me(fp) && the_v2_networkstatus)
|
||||||
d = the_v2_networkstatus;
|
d = the_v2_networkstatus;
|
||||||
else if (cached_v2_networkstatus)
|
else if (cached_v2_networkstatus)
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
#ifdef HAVE_EVENT2_DNS_H
|
#ifdef HAVE_EVENT2_DNS_H
|
||||||
#include <event2/dns.h>
|
#include <event2/dns.h>
|
||||||
#include <event2/dns_compat.h>
|
#include <event2/dns_compat.h>
|
||||||
/* XXXX022 this implies we want an improved evdns */
|
/* XXXX023 this implies we want an improved evdns */
|
||||||
#include <event2/dns_struct.h>
|
#include <event2/dns_struct.h>
|
||||||
#else
|
#else
|
||||||
#include "eventdns.h"
|
#include "eventdns.h"
|
||||||
|
@ -1999,7 +1999,7 @@ evdns_request_timeout_callback(int fd, short events, void *arg) {
|
|||||||
/* retransmit it */
|
/* retransmit it */
|
||||||
/* Stop waiting for the timeout. No need to do this in
|
/* Stop waiting for the timeout. No need to do this in
|
||||||
* request_finished; that one already deletes the timeout event.
|
* request_finished; that one already deletes the timeout event.
|
||||||
* XXXX021 port this change to libevent. */
|
* XXXX023 port this change to libevent. */
|
||||||
del_timeout_event(req);
|
del_timeout_event(req);
|
||||||
evdns_request_transmit(req);
|
evdns_request_transmit(req);
|
||||||
}
|
}
|
||||||
|
@ -601,8 +601,9 @@ _dirreq_map_put(dirreq_map_entry_t *entry, dirreq_type_t type,
|
|||||||
tor_assert(entry->type == type);
|
tor_assert(entry->type == type);
|
||||||
tor_assert(entry->dirreq_id == dirreq_id);
|
tor_assert(entry->dirreq_id == dirreq_id);
|
||||||
|
|
||||||
/* XXXX022 once we're sure the bug case never happens, we can switch
|
/* XXXX we could switch this to HT_INSERT some time, since it seems that
|
||||||
* to HT_INSERT */
|
* this bug doesn't happen. But since this function doesn't seem to be
|
||||||
|
* critical-path, it's sane to leave it alone. */
|
||||||
old_ent = HT_REPLACE(dirreqmap, &dirreq_map, entry);
|
old_ent = HT_REPLACE(dirreqmap, &dirreq_map, entry);
|
||||||
if (old_ent && old_ent != entry) {
|
if (old_ent && old_ent != entry) {
|
||||||
log_warn(LD_BUG, "Error when putting directory request into local "
|
log_warn(LD_BUG, "Error when putting directory request into local "
|
||||||
|
@ -1606,7 +1606,7 @@ networkstatus_set_current_consensus(const char *consensus,
|
|||||||
|
|
||||||
if (from_cache && !accept_obsolete &&
|
if (from_cache && !accept_obsolete &&
|
||||||
c->valid_until < now-OLD_ROUTER_DESC_MAX_AGE) {
|
c->valid_until < now-OLD_ROUTER_DESC_MAX_AGE) {
|
||||||
/* XXX022 when we try to make fallbackconsensus work again, we should
|
/* XXXX If we try to make fallbackconsensus work again, we should
|
||||||
* consider taking this out. Until then, believing obsolete consensuses
|
* consider taking this out. Until then, believing obsolete consensuses
|
||||||
* is causing more harm than good. See also bug 887. */
|
* is causing more harm than good. See also bug 887. */
|
||||||
log_info(LD_DIR, "Loaded an expired consensus. Discarding.");
|
log_info(LD_DIR, "Loaded an expired consensus. Discarding.");
|
||||||
|
@ -1006,7 +1006,7 @@ typedef struct connection_t {
|
|||||||
/** Unique identifier for this connection on this Tor instance. */
|
/** Unique identifier for this connection on this Tor instance. */
|
||||||
uint64_t global_identifier;
|
uint64_t global_identifier;
|
||||||
|
|
||||||
/* XXXX022 move this field, and all the listener-only fields (just
|
/* XXXX023 move this field, and all the listener-only fields (just
|
||||||
socket_family, I think), into a new listener_connection_t subtype. */
|
socket_family, I think), into a new listener_connection_t subtype. */
|
||||||
/** If the connection is a CONN_TYPE_AP_DNS_LISTENER, this field points
|
/** If the connection is a CONN_TYPE_AP_DNS_LISTENER, this field points
|
||||||
* to the evdns_server_port is uses to listen to and answer connections. */
|
* to the evdns_server_port is uses to listen to and answer connections. */
|
||||||
|
@ -174,7 +174,7 @@ errno_to_stream_end_reason(int e)
|
|||||||
S_CASE(ENETUNREACH):
|
S_CASE(ENETUNREACH):
|
||||||
return END_STREAM_REASON_INTERNAL;
|
return END_STREAM_REASON_INTERNAL;
|
||||||
S_CASE(EHOSTUNREACH):
|
S_CASE(EHOSTUNREACH):
|
||||||
/* XXXX022
|
/* XXXX023
|
||||||
* The correct behavior is END_STREAM_REASON_NOROUTE, but older
|
* The correct behavior is END_STREAM_REASON_NOROUTE, but older
|
||||||
* clients don't recognize it. So we're going to continue sending
|
* clients don't recognize it. So we're going to continue sending
|
||||||
* "MISC" until 0.2.1.27 or later is "well established".
|
* "MISC" until 0.2.1.27 or later is "well established".
|
||||||
|
@ -599,7 +599,7 @@ rend_client_rendezvous_acked(origin_circuit_t *circ, const uint8_t *request,
|
|||||||
log_info(LD_REND,"Got rendezvous ack. This circuit is now ready for "
|
log_info(LD_REND,"Got rendezvous ack. This circuit is now ready for "
|
||||||
"rendezvous.");
|
"rendezvous.");
|
||||||
circ->_base.purpose = CIRCUIT_PURPOSE_C_REND_READY;
|
circ->_base.purpose = CIRCUIT_PURPOSE_C_REND_READY;
|
||||||
/* XXXX022 This is a pretty brute-force approach. It'd be better to
|
/* XXXX023 This is a pretty brute-force approach. It'd be better to
|
||||||
* attach only the connections that are waiting on this circuit, rather
|
* attach only the connections that are waiting on this circuit, rather
|
||||||
* than trying to attach them all. See comments bug 743. */
|
* than trying to attach them all. See comments bug 743. */
|
||||||
/* If we already have the introduction circuit built, make sure we send
|
/* If we already have the introduction circuit built, make sure we send
|
||||||
@ -669,7 +669,7 @@ rend_client_receive_rendezvous(origin_circuit_t *circ, const uint8_t *request,
|
|||||||
|
|
||||||
onion_append_to_cpath(&circ->cpath, hop);
|
onion_append_to_cpath(&circ->cpath, hop);
|
||||||
circ->build_state->pending_final_cpath = NULL; /* prevent double-free */
|
circ->build_state->pending_final_cpath = NULL; /* prevent double-free */
|
||||||
/* XXXX022 This is a pretty brute-force approach. It'd be better to
|
/* XXXX023 This is a pretty brute-force approach. It'd be better to
|
||||||
* attach only the connections that are waiting on this circuit, rather
|
* attach only the connections that are waiting on this circuit, rather
|
||||||
* than trying to attach them all. See comments bug 743. */
|
* than trying to attach them all. See comments bug 743. */
|
||||||
connection_ap_attach_pending();
|
connection_ap_attach_pending();
|
||||||
|
@ -932,7 +932,7 @@ rend_cache_lookup_entry(const char *query, int version, rend_cache_entry_t **e)
|
|||||||
if (!*e)
|
if (!*e)
|
||||||
return 0;
|
return 0;
|
||||||
tor_assert((*e)->parsed && (*e)->parsed->intro_nodes);
|
tor_assert((*e)->parsed && (*e)->parsed->intro_nodes);
|
||||||
/* XXX022 hack for now, to return "not found" if there are no intro
|
/* XXX023 hack for now, to return "not found" if there are no intro
|
||||||
* points remaining. See bug 997. */
|
* points remaining. See bug 997. */
|
||||||
if (smartlist_len((*e)->parsed->intro_nodes) == 0)
|
if (smartlist_len((*e)->parsed->intro_nodes) == 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -587,7 +587,7 @@ rep_hist_get_weighted_time_known(const char *id, time_t when)
|
|||||||
int
|
int
|
||||||
rep_hist_have_measured_enough_stability(void)
|
rep_hist_have_measured_enough_stability(void)
|
||||||
{
|
{
|
||||||
/* XXXX021 This doesn't do so well when we change our opinion
|
/* XXXX022 This doesn't do so well when we change our opinion
|
||||||
* as to whether we're tracking router stability. */
|
* as to whether we're tracking router stability. */
|
||||||
return started_tracking_stability < time(NULL) - 4*60*60;
|
return started_tracking_stability < time(NULL) - 4*60*60;
|
||||||
}
|
}
|
||||||
|
@ -1770,7 +1770,7 @@ smartlist_choose_by_bandwidth_weights(smartlist_t *sl,
|
|||||||
sl_last_weighted_bw_of_me = weight*this_bw;
|
sl_last_weighted_bw_of_me = weight*this_bw;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXXX022 this is a kludge to expose these values. */
|
/* XXXX023 this is a kludge to expose these values. */
|
||||||
sl_last_total_weighted_bw = weighted_bw;
|
sl_last_total_weighted_bw = weighted_bw;
|
||||||
|
|
||||||
log_debug(LD_CIRC, "Choosing node for rule %s based on weights "
|
log_debug(LD_CIRC, "Choosing node for rule %s based on weights "
|
||||||
@ -1893,7 +1893,7 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule,
|
|||||||
if (status->has_bandwidth) {
|
if (status->has_bandwidth) {
|
||||||
this_bw = kb_to_bytes(status->bandwidth);
|
this_bw = kb_to_bytes(status->bandwidth);
|
||||||
} else { /* guess */
|
} else { /* guess */
|
||||||
/* XXX022 once consensuses always list bandwidths, we can take
|
/* XXX023 once consensuses always list bandwidths, we can take
|
||||||
* this guessing business out. -RD */
|
* this guessing business out. -RD */
|
||||||
is_known = 0;
|
is_known = 0;
|
||||||
flags = status->is_fast ? 1 : 0;
|
flags = status->is_fast ? 1 : 0;
|
||||||
@ -1912,7 +1912,7 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule,
|
|||||||
if (rs && rs->has_bandwidth) {
|
if (rs && rs->has_bandwidth) {
|
||||||
this_bw = kb_to_bytes(rs->bandwidth);
|
this_bw = kb_to_bytes(rs->bandwidth);
|
||||||
} else if (rs) { /* guess; don't trust the descriptor */
|
} else if (rs) { /* guess; don't trust the descriptor */
|
||||||
/* XXX022 once consensuses always list bandwidths, we can take
|
/* XXX023 once consensuses always list bandwidths, we can take
|
||||||
* this guessing business out. -RD */
|
* this guessing business out. -RD */
|
||||||
is_known = 0;
|
is_known = 0;
|
||||||
flags = router->is_fast ? 1 : 0;
|
flags = router->is_fast ? 1 : 0;
|
||||||
@ -2028,7 +2028,7 @@ smartlist_choose_by_bandwidth(smartlist_t *sl, bandwidth_weight_rule_t rule,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXXX022 this is a kludge to expose these values. */
|
/* XXXX023 this is a kludge to expose these values. */
|
||||||
sl_last_total_weighted_bw = total_bw;
|
sl_last_total_weighted_bw = total_bw;
|
||||||
|
|
||||||
log_debug(LD_CIRC, "Total weighted bw = "U64_FORMAT
|
log_debug(LD_CIRC, "Total weighted bw = "U64_FORMAT
|
||||||
@ -3395,7 +3395,7 @@ router_add_extrainfo_to_routerlist(extrainfo_t *ei, const char **msg,
|
|||||||
int inserted;
|
int inserted;
|
||||||
(void)from_fetch;
|
(void)from_fetch;
|
||||||
if (msg) *msg = NULL;
|
if (msg) *msg = NULL;
|
||||||
/*XXXX022 Do something with msg */
|
/*XXXX023 Do something with msg */
|
||||||
|
|
||||||
inserted = extrainfo_insert(router_get_routerlist(), ei);
|
inserted = extrainfo_insert(router_get_routerlist(), ei);
|
||||||
|
|
||||||
@ -4591,7 +4591,7 @@ update_consensus_router_descriptor_downloads(time_t now, int is_vote,
|
|||||||
|
|
||||||
/** How often should we launch a server/authority request to be sure of getting
|
/** How often should we launch a server/authority request to be sure of getting
|
||||||
* a guess for our IP? */
|
* a guess for our IP? */
|
||||||
/*XXXX021 this info should come from netinfo cells or something, or we should
|
/*XXXX023 this info should come from netinfo cells or something, or we should
|
||||||
* do this only when we aren't seeing incoming data. see bug 652. */
|
* do this only when we aren't seeing incoming data. see bug 652. */
|
||||||
#define DUMMY_DOWNLOAD_INTERVAL (20*60)
|
#define DUMMY_DOWNLOAD_INTERVAL (20*60)
|
||||||
|
|
||||||
@ -4609,7 +4609,7 @@ update_router_descriptor_downloads(time_t now)
|
|||||||
update_consensus_router_descriptor_downloads(now, 0,
|
update_consensus_router_descriptor_downloads(now, 0,
|
||||||
networkstatus_get_reasonably_live_consensus(now));
|
networkstatus_get_reasonably_live_consensus(now));
|
||||||
|
|
||||||
/* XXXX021 we could be smarter here; see notes on bug 652. */
|
/* XXXX023 we could be smarter here; see notes on bug 652. */
|
||||||
/* If we're a server that doesn't have a configured address, we rely on
|
/* If we're a server that doesn't have a configured address, we rely on
|
||||||
* directory fetches to learn when our address changes. So if we haven't
|
* directory fetches to learn when our address changes. So if we haven't
|
||||||
* tried to get any routerdescs in a long time, try a dummy fetch now. */
|
* tried to get any routerdescs in a long time, try a dummy fetch now. */
|
||||||
|
@ -1818,7 +1818,7 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
|
|||||||
struct in_addr in;
|
struct in_addr in;
|
||||||
char *address = NULL;
|
char *address = NULL;
|
||||||
tor_assert(tok->n_args);
|
tor_assert(tok->n_args);
|
||||||
/* XXX021 use tor_addr_port_parse() below instead. -RD */
|
/* XXX023 use tor_addr_port_parse() below instead. -RD */
|
||||||
if (parse_addr_port(LOG_WARN, tok->args[0], &address, NULL,
|
if (parse_addr_port(LOG_WARN, tok->args[0], &address, NULL,
|
||||||
&cert->dir_port)<0 ||
|
&cert->dir_port)<0 ||
|
||||||
tor_inet_aton(address, &in) == 0) {
|
tor_inet_aton(address, &in) == 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user