/* ======
* IPv4 helpers
- * XXXX023 IPv6 deprecate some of these.
+ * XXXX024 IPv6 deprecate some of these.
*/
/** Return true iff <b>ip</b> (in host order) is an IP reserved to localhost,
/* This is required on rh7 to make strptime not complain.
* We also need it to make memmem get defined (where available)
*/
-/* XXXX023 We should just use AC_USE_SYSTEM_EXTENSIONS in our autoconf,
+/* XXXX024 We should just use AC_USE_SYSTEM_EXTENSIONS in our autoconf,
* and get this (and other important stuff!) automatically. Once we do that,
* make sure to also change the extern char **environ detection in
* configure.in, because whether that is declared or not depends on whether
* (because of EOF), set *<b>reached_eof</b> to 1 and return 0. Return -1 on
* error; else return the number of bytes read.
*/
-/* XXXX023 indicate "read blocked" somehow? */
+/* XXXX024 indicate "read blocked" somehow? */
int
read_to_buf(tor_socket_t s, size_t at_most, buf_t *buf, int *reached_eof,
int *socket_error)
{
- /* XXXX023 It's stupid to overload the return values for these functions:
+ /* XXXX024 It's stupid to overload the return values for these functions:
* "error status" and "number of bytes read" are not mutually exclusive.
*/
int r = 0;
int
flush_buf(tor_socket_t s, buf_t *buf, size_t sz, size_t *buf_flushlen)
{
- /* XXXX023 It's stupid to overload the return values for these functions:
+ /* XXXX024 It's stupid to overload the return values for these functions:
* "error status" and "number of bytes flushed" are not mutually exclusive.
*/
int r;
/********* START VARIABLES **********/
/** Global list of circuit build times */
-// XXXX023: Add this as a member for entry_guard_t instead of global?
+// XXXX: Add this as a member for entry_guard_t instead of global?
// Then we could do per-guard statistics, as guards are likely to
// vary in their own latency. The downside of this is that guards
// can change frequently, so we'd be building a lot more circuits
// most likely.
-/* XXXX023 Make this static; add accessor functions. */
+/* XXXX024 Make this static; add accessor functions. */
circuit_build_times_t circ_times;
/** A global list of all circuits at this hop. */
* If <b>mark_relay_status</b>, also call router_set_status() on this
* relay.
*
- * XXX023 change succeeded and mark_relay_status into 'int flags'.
+ * XXX024 change succeeded and mark_relay_status into 'int flags'.
*/
int
entry_guard_register_connect_status(const char *digest, int succeeded,
}
entry_guards = new_entry_guards;
entry_guards_dirty = 0;
- /* XXX023 hand new_entry_guards to this func, and move it up a
+ /* XXX024 hand new_entry_guards to this func, and move it up a
* few lines, so we don't have to re-dirty it */
if (remove_obsolete_entry_guards(now))
entry_guards_dirty = 1;
* This is useful for letting the user change pseudonyms, so new
* streams will not be linkable to old streams.
*/
-/* XXX023 this is a bad name for what this function does */
+/* XXX024 this is a bad name for what this function does */
void
circuit_expire_all_dirty_circs(void)
{
if (CIRCUIT_IS_ORIGIN(circ) &&
!circ->marked_for_close &&
circ->timestamp_dirty)
- /* XXXX023 This is a screwed-up way to say "This is too dirty
+ /* XXXX024 This is a screwed-up way to say "This is too dirty
* for new circuits. */
circ->timestamp_dirty -= options->MaxCircuitDirtiness;
}
return -1;
}
} else {
- /* XXXX023 Duplicates checks in connection_ap_handshake_attach_circuit:
+ /* XXXX024 Duplicates checks in connection_ap_handshake_attach_circuit:
* refactor into a single function? */
const node_t *node = node_get_by_nickname(conn->chosen_exit_name, 1);
int opt = conn->chosen_exit_optional;
/* find the circuit that we should use, if there is one. */
retval = circuit_get_open_circ_or_launch(
conn, CIRCUIT_PURPOSE_C_GENERAL, &circ);
- if (retval < 1) // XXX022 if we totally fail, this still returns 0 -RD
+ if (retval < 1) // XXX023 if we totally fail, this still returns 0 -RD
return retval;
log_debug(LD_APP|LD_CIRC,
|| !geoip_is_loaded())) {
/* XXXX Don't use this "<default>" junk; make our filename options
* understand prefixes somehow. -NM */
- /* XXXX023 Reload GeoIPFile on SIGHUP. -NM */
+ /* XXXX024 Reload GeoIPFile on SIGHUP. -NM */
char *actual_fname = tor_strdup(options->GeoIPFile);
#ifdef _WIN32
if (!strcmp(actual_fname, "<default>")) {
"ignore you.");
}
- /*XXXX023 checking for defaults manually like this is a bit fragile.*/
+ /*XXXX checking for defaults manually like this is a bit fragile.*/
/* Keep changes to hard-coded values synchronous to man page and default
* values table. */
record_num_bytes_transferred(connection_t *conn,
time_t now, size_t num_read, size_t num_written)
{
- /* XXX023 check if this is necessary */
+ /* XXX024 check if this is necessary */
if (num_written >= INT_MAX || num_read >= INT_MAX) {
log_err(LD_BUG, "Value out of range. num_read=%lu, num_written=%lu, "
"connection type=%s, state=%s",
connection_consider_empty_read_buckets(conn);
if (conn->type == CONN_TYPE_AP) {
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
- /*XXXX022 check for overflow*/
+ /*XXXX024 check for overflow*/
edge_conn->n_read += (int)info->n_added;
}
}
connection_consider_empty_write_buckets(conn);
if (conn->type == CONN_TYPE_AP) {
edge_connection_t *edge_conn = TO_EDGE_CONN(conn);
- /*XXXX022 check for overflow*/
+ /*XXXX024 check for overflow*/
edge_conn->n_written += (int)info->n_deleted;
}
}
* being attached to a circuit, assume that an attempt to connect to
* the destination hidden service has just ended.
*
- * XXX023 This condition doesn't limit to only streams failing
+ * XXXX This condition doesn't limit to only streams failing
* without ever being attached. That sloppiness should be harmless,
* but we should fix it someday anyway. */
if ((edge_conn->on_circuit != NULL || edge_conn->edge_has_sent_end) &&
/* kludge to make us not try this circuit again, yet to allow
* current streams on it to survive if they can: make it
* unattractive to use for new streams */
- /* XXXX023 this is a kludgy way to do this. */
+ /* XXXX024 this is a kludgy way to do this. */
tor_assert(circ->timestamp_dirty);
circ->timestamp_dirty -= options->MaxCircuitDirtiness;
/* give our stream another 'cutoff' seconds to try */
/** Tell any AP streams that are waiting for a one-hop tunnel to
* <b>failed_digest</b> that they are going to fail. */
-/* XXX023 We should get rid of this function, and instead attach
+/* XXX024 We should get rid of this function, and instead attach
* one-hop streams to circ->p_streams so they get marked in
* circuit_mark_for_close like normal p_streams. */
void
connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL);
return -1;
}
- /* XXXX022-1090 Should we also allow foo.bar.exit if ExitNodes is set and
+ /* XXXX024-1090 Should we also allow foo.bar.exit if ExitNodes is set and
Bar is not listed in it? I say yes, but our revised manpage branch
implies no. */
}
edge_conn->stream_id = get_unique_stream_id_by_circ(circ);
if (edge_conn->stream_id==0) {
- /* XXXX023 Instead of closing this stream, we should make it get
+ /* XXXX024 Instead of closing this stream, we should make it get
* retried on another circuit. */
connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL);
/* Mark this circuit "unusable for new streams". */
- /* XXXX023 this is a kludgy way to do this. */
+ /* XXXX024 this is a kludgy way to do this. */
tor_assert(circ->_base.timestamp_dirty);
circ->_base.timestamp_dirty -= get_options()->MaxCircuitDirtiness;
return -1;
edge_conn->stream_id = get_unique_stream_id_by_circ(circ);
if (edge_conn->stream_id==0) {
- /* XXXX023 Instead of closing this stream, we should make it get
+ /* XXXX024 Instead of closing this stream, we should make it get
* retried on another circuit. */
connection_mark_unattached_ap(ap_conn, END_STREAM_REASON_INTERNAL);
/* Mark this circuit "unusable for new streams". */
- /* XXXX023 this is a kludgy way to do this. */
+ /* XXXX024 this is a kludgy way to do this. */
tor_assert(circ->_base.timestamp_dirty);
circ->_base.timestamp_dirty -= get_options()->MaxCircuitDirtiness;
return -1;
* 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.
**/
-/* XXXX023 the use of the ttl and expires fields is nutty. Let's make this
+/* XXXX the use of the ttl and expires fields is nutty. Let's make this
* interface and those that use it less ugly. */
void
connection_ap_handshake_socks_resolved(entry_connection_t *conn,
* check would otherwise just let data accumulate. It serves no purpose
* in 0.2.3.
*
- * XXX023 Remove this check once we verify that the above paragraph is
+ * XXX024 Remove this check once we verify that the above paragraph is
* 100% true. */
if (buf_datalen(conn->_base.inbuf) > MAX_OR_INBUF_WHEN_NONOPEN) {
log_fn(LOG_PROTOCOL_WARN, LD_NET, "Accumulated too much data (%d bytes) "
void
dirserv_set_router_is_running(routerinfo_t *router, time_t now)
{
- /*XXXX023 This function is a mess. Separate out the part that calculates
+ /*XXXX024 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
unreachable.
*/
{
if (need_uptime) {
if (!enough_mtbf_info) {
- /* XXX023 Once most authorities are on v3, we should change the rule from
+ /* XXX024 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
* 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,
tor_version_t router_version;
- /* XXX023 This block should be extracted into its own function. */
+ /* XXX024 This block should be extracted into its own function. */
/* XXXX Begin code copied from tor_version_as_new_as (in routerparse.c) */
{
char *s, *s2, *start;
d = strmap_get(cached_consensuses, "ns");
else if (memchr(fp, '\0', DIGEST_LEN) && cached_consensuses &&
(d = strmap_get(cached_consensuses, fp))) {
- /* this here interface is a nasty hack XXXX023 */;
+ /* this here interface is a nasty hack XXXX024 */;
} else if (router_digest_is_me(fp) && the_v2_networkstatus)
d = the_v2_networkstatus;
else if (cached_v2_networkstatus)
}
body = signed_descriptor_get_body(sd);
if (conn->zlib_state) {
- /* XXXX022 This 'last' business should actually happen on the last
+ /* XXXX024 This 'last' business should actually happen on the last
* routerinfo, not on the last fingerprint. */
int last = ! smartlist_len(conn->fingerprint_stack);
connection_write_to_buf_zlib(body, sd->signed_descriptor_len, conn,
if (!md)
continue;
if (conn->zlib_state) {
- /* XXXX022 This 'last' business should actually happen on the last
+ /* XXXX024 This 'last' business should actually happen on the last
* routerinfo, not on the last fingerprint. */
int last = !smartlist_len(conn->fingerprint_stack);
connection_write_to_buf_zlib(md->body, md->bodylen, conn, last);
#ifdef HAVE_EVENT2_DNS_H
#include <event2/dns.h>
#include <event2/dns_compat.h>
-/* XXXX023 this implies we want an improved evdns */
+/* XXXX this implies we want an improved evdns */
#include <event2/dns_struct.h>
#else
#include "eventdns.h"
* We do this before step 4, so it can try building more if
* it's not comfortable with the number of available circuits.
*/
- /* XXXX022 If our circuit build timeout is much lower than a second, maybe
- * we should do this more often? -NM
- * It can't be lower than 1.5 seconds currently; see
- * circuit_build_times_min_timeout(). -RD
- */
+ /* (If our circuit build timeout can ever become lower than a second (which
+ * it can't, currently), we should do this more often.) */
circuit_expire_building();
/** 3b. Also look at pending streams and prune the ones that 'began'
md->body = (char*)cache->cache_content->data + md->off;
if (PREDICT_UNLIKELY(
md->bodylen < 9 || fast_memneq(md->body, "onion-key", 9) != 0)) {
- /* XXXX023 once bug 2022 is solved, we can kill this block and turn it
+ /* XXXX once bug 2022 is solved, we can kill this block and turn it
* into just the tor_assert(!memcmp) */
off_t avail = cache->cache_content->size - md->off;
char *bad_str;
routerstatus_list_update_named_server_map();
cell_ewma_set_scale_factor(options, current_consensus);
- /* XXXX023 this call might be unnecessary here: can changing the
+ /* XXXX024 this call might be unnecessary here: can changing the
* current consensus really alter our view of any OR's rate limits? */
connection_or_update_token_buckets(get_connection_array(), options);
/* We haven't retried too many times; reattach the connection. */
circuit_log_path(LOG_INFO,LD_APP,circ);
/* Mark this circuit "unusable for new streams". */
- /* XXXX023 this is a kludgy way to do this. */
+ /* XXXX024 this is a kludgy way to do this. */
tor_assert(circ->_base.timestamp_dirty);
circ->_base.timestamp_dirty -= get_options()->MaxCircuitDirtiness;
stats_n_data_cells_packaged += 1;
if (PREDICT_UNLIKELY(sending_from_optimistic)) {
- /* XXX023 We could be more efficient here by sometimes packing
+ /* XXXX We could be more efficient here by sometimes packing
* previously-sent optimistic data in the same cell with data
* from the inbuf. */
generic_buffer_get(entry_conn->sending_optimistic_data, payload, length);
/* Set timestamp_dirty, because circuit_expire_building expects it
* to specify when a circuit entered the _C_REND_READY state. */
circ->_base.timestamp_dirty = time(NULL);
- /* XXXX023 This is a pretty brute-force approach. It'd be better to
+ /* XXXX This is a pretty brute-force approach. It'd be better to
* attach only the connections that are waiting on this circuit, rather
* than trying to attach them all. See comments bug 743. */
/* If we already have the introduction circuit built, make sure we send
/** Respond to an INTRODUCE2 cell by launching a circuit to the chosen
* rendezvous point.
*/
- /* XXX022 this function sure could use some organizing. -RD */
+ /* XXXX024 this function sure could use some organizing. -RD */
int
rend_service_introduce(origin_circuit_t *circuit, const uint8_t *request,
size_t request_len)
*
* Unfortunately, we can't find out when the new descriptor
* has actually been uploaded, so we'll have to settle for a
- * five-minute timer. Start it. XXX023 This sucks. */
+ * five-minute timer. Start it. XXXX024 This sucks. */
intro->time_expiring = now;
intro_point_set_changed = 1;
int
rep_hist_have_measured_enough_stability(void)
{
- /* XXXX022 This doesn't do so well when we change our opinion
+ /* XXXX023 This doesn't do so well when we change our opinion
* as to whether we're tracking router stability. */
return started_tracking_stability < time(NULL) - 4*60*60;
}
sl_last_weighted_bw_of_me = weight*this_bw;
} SMARTLIST_FOREACH_END(node);
- /* XXXX023 this is a kludge to expose these values. */
+ /* XXXX this is a kludge to expose these values. */
sl_last_total_weighted_bw = weighted_bw;
log_debug(LD_CIRC, "Choosing node for rule %s based on weights "
if (node->rs->has_bandwidth) {
this_bw = kb_to_bytes(node->rs->bandwidth);
} else { /* guess */
- /* XXX023 once consensuses always list bandwidths, we can take
+ /* XXX024 once consensuses always list bandwidths, we can take
* this guessing business out. -RD */
is_known = 0;
flags = node->rs->is_fast ? 1 : 0;
}
}
- /* XXXX023 this is a kludge to expose these values. */
+ /* XXXX this is a kludge to expose these values. */
sl_last_total_weighted_bw = total_bw;
log_debug(LD_CIRC, "Total weighted bw = "U64_FORMAT
/** How often should we launch a server/authority request to be sure of getting
* a guess for our IP? */
-/*XXXX023 this info should come from netinfo cells or something, or we should
+/*XXXX024 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. */
#define DUMMY_DOWNLOAD_INTERVAL (20*60)
const or_options_t *options)
{
static time_t last_dummy_download = 0;
- /* XXXX023 we could be smarter here; see notes on bug 652. */
+ /* XXXX024 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
* 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. */
struct in_addr in;
char *address = NULL;
tor_assert(tok->n_args);
- /* XXX023 use some tor_addr parse function below instead. -RD */
+ /* XXX024 use some tor_addr parse function below instead. -RD */
if (tor_addr_port_split(LOG_WARN, tok->args[0], &address,
&cert->dir_port) < 0 ||
tor_inet_aton(address, &in) == 0) {
tor_free(bindaddr_tmp);
}
- /* XXX023 Remove the '=' here once versions of obfsproxy which
+ /* XXX024 Remove the '=' here once versions of obfsproxy which
* assert that this env var exists are sufficiently dead.
*
* (If we remove this line entirely, some joker will stick this