r11736@Kushana: nickm | 2006-12-28 17:46:23 -0500

Mark a pile of XXXX comments as targetted for 0.1.2: some because they look important, some because they look easy.


svn:r9205
This commit is contained in:
Nick Mathewson 2006-12-29 02:47:51 +00:00
parent 0bbbf98be4
commit b59573949e
10 changed files with 30 additions and 38 deletions

View File

@ -441,15 +441,8 @@ connection_about_to_close_connection(connection_t *conn)
* give up. */
circuit_n_conn_done(TO_OR_CONN(conn), 0);
} else if (conn->hold_open_until_flushed) {
/* XXXX009 We used to have an arg that told us whether we closed the
* connection on purpose or not. Can we use hold_open_until_flushed
* instead? We only set it when we are intentionally closing a
* connection. -NM
*
* (Of course, now things we set to close which expire rather than
* flushing still get noted as dead, not disconnected. But this is an
* improvement. -NM
*/
/* We only set hold_open_until_flushed when we're intentionally
* closing a connection. */
rep_hist_note_disconnect(or_conn->identity_digest, now);
control_event_or_conn_status(or_conn, OR_CONN_EVENT_CLOSED);
} else if (or_conn->identity_digest) {
@ -1482,7 +1475,7 @@ connection_read_to_buf(connection_t *conn, int *max_to_read)
}
pending = tor_tls_get_pending_bytes(or_conn->tls);
if (pending) {
/* XXXX If we have any pending bytes, read them now. This *can*
/* XXXX012 If we have any pending bytes, read them now. This *can*
* take us over our read allotment, but really we shouldn't be
* believing that SSL bytes are the same as TCP bytes anyway. */
int r2 = read_to_buf_tls(or_conn->tls, pending, conn->inbuf);
@ -1715,7 +1708,7 @@ connection_handle_write(connection_t *conn)
void
_connection_controller_force_write(control_connection_t *control_conn)
{
/* XXX This is hideous code duplication, but raising it seems a little
/* XXXX012 This is hideous code duplication, but raising it seems a little
* tricky for now. Think more about this one. We only call it for
* EVENT_ERR_MSG, so messing with buckets a little isn't such a big problem.
*/
@ -2296,7 +2289,7 @@ assert_connection_ok(connection_t *conn, time_t now)
if (conn->hold_open_until_flushed)
tor_assert(conn->marked_for_close);
/* XXX check: wants_to_read, wants_to_write, s, conn_array_index,
/* XXXX012 check: wants_to_read, wants_to_write, s, conn_array_index,
* marked_for_close. */
/* buffers */
@ -2305,7 +2298,7 @@ assert_connection_ok(connection_t *conn, time_t now)
assert_buf_ok(conn->outbuf);
}
/* XXX Fix this; no longer so.*/
/* XXXX012 Fix this; no longer so.*/
#if 0
if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)
tor_assert(!conn->pkey);

View File

@ -1289,7 +1289,7 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
/* help predict this next time */
rep_hist_note_used_port(socks->port, time(NULL));
} else if (socks->command == SOCKS_COMMAND_RESOLVE_PTR) {
// XXXX NM Do anything here?
// XXXX012 NM Do anything here?
rep_hist_note_used_resolve(time(NULL)); /* help predict this next time */
} else if (socks->command == SOCKS_COMMAND_CONNECT_DIR) {
@ -1585,11 +1585,10 @@ connection_ap_process_transparent(edge_connection_t *conn)
return connection_ap_handshake_rewrite_and_attach(conn, NULL);
}
/** connection_edge_process_inbuf() found a conn in state
* natd_wait. See if conn-\>inbuf has the right bytes to proceed.
* See libalias(3) and ProxyEncodeTcpStream() in alias_proxy.c for
* the encoding form of the original destination.
* XXX what is "alias_proxy.c"? -RD
/** connection_edge_process_inbuf() found a conn in state natd_wait. See if
* conn-\>inbuf has the right bytes to proceed. See FreeBSD's libalias(3) and
* ProxyEncodeTcpStream() in src/lib/libalias/alias_proxy.c for the encoding
* form of the original destination.
*
* If the original destination is complete, send it to
* connection_ap_handshake_rewrite_and_attach().

View File

@ -104,11 +104,13 @@ connection_or_set_identity_digest(or_connection_t *conn, const char *digest)
tmp = digestmap_set(orconn_identity_map, digest, conn);
conn->next_with_same_id = tmp;
/* Checking code; remove once I'm sure this works. XXXX*/
#if 0
/* Testing code to check for bugs in representation. */
for (; tmp; tmp = tmp->next_with_same_id) {
tor_assert(!memcmp(tmp->identity_digest, digest, DIGEST_LEN));
tor_assert(tmp != conn);
}
#endif
}
/** Pack the cell_t host-order structure <b>src</b> into network-order

View File

@ -359,7 +359,7 @@ connection_dir_download_routerdesc_failed(dir_connection_t *conn)
* it's not their fault.*/
/* update_router_descriptor_downloads(time(NULL)); */
(void) conn;
/* XXXX Why did the above get commented out? -NM */
/* XXXX012 Why did the above get commented out? -NM */
}
/** Helper for directory_initiate_command_(router|trusted_dir): send the
@ -1307,7 +1307,7 @@ connection_dir_process_inbuf(dir_connection_t *conn)
return 0;
}
/* XXX for READ states, might want to make sure inbuf isn't too big */
/* XXXX012 for READ states, might want to make sure inbuf isn't too big */
if (!conn->_base.inbuf_reached_eof)
log_debug(LD_HTTP,"Got data, not eof. Leaving on inbuf.");

View File

@ -1610,7 +1610,7 @@ generate_v2_networkstatus(void)
}
/* DOCDOC */
/* XXXX This can be replace a lot of dirserv_get_networkstatus_v2(). */
/* XXXX012 This can be replace a lot of dirserv_get_networkstatus_v2(). */
void
dirserv_get_networkstatus_v2_fingerprints(smartlist_t *result,
const char *key)
@ -1858,7 +1858,7 @@ dirserv_orconn_tls_done(const char *address,
tor_assert(address);
tor_assert(digest_rcvd);
tor_assert(nickname_rcvd);
(void) as_advertised; // XXXX This should really be implemented. -NM
(void) as_advertised; // XXXX012 This should really be implemented. -NM
// XXXXNM We should really have a better solution here than dropping
// XXXXNM whole routers; otherwise, they come back way too easily.
@ -1867,7 +1867,8 @@ dirserv_orconn_tls_done(const char *address,
int drop = 0;
if (strcasecmp(address, ri->address) || or_port != ri->or_port)
continue;
/* XXX For 0.1.2.x, we should do something smarter here than !is_valid. */
/* XXX012 For 0.1.2.x, we should do something smarter here than !is_valid.
*/
if (!ri->is_valid) {
/* We have a router at the same address! */
if (strcasecmp(ri->nickname, nickname_rcvd)) {

View File

@ -798,7 +798,7 @@ reply_parse(u8 *packet, int length) {
req = request_find_from_trans_id(trans_id);
if (!req) return -1;
// XXXX should the other return points also call reply_handle? -NM
// XXXX012 should the other return points also call reply_handle? -NM
memset(&reply, 0, sizeof(reply));

View File

@ -195,7 +195,8 @@ circuit_receive_relay_cell(cell_t *cell, circuit_t *circ, int cell_direction)
cell->circ_id = TO_OR_CIRCUIT(circ)->p_circ_id; /* switch it */
or_conn = TO_OR_CIRCUIT(circ)->p_conn;
} else {
// XXXX NM WARN.
log_fn(LOG_PROTOCOL_WARN, LD_OR,
"Dropping unrecognized inbound cell on origin circuit.");
return 0;
}
@ -1395,12 +1396,6 @@ circuit_consider_stop_edge_reading(circuit_t *circ, crypt_path_t *layer_hint)
layer_hint->package_window);
if (layer_hint->package_window <= 0) {
log_debug(domain,"yes, at-origin. stopped.");
#if 0
// XXXX NM DEAD CODE.
for (conn = circ->n_streams; conn; conn=conn->next_stream)
if (conn->cpath_layer == layer_hint)
connection_stop_reading(conn);
#endif
for (conn = TO_ORIGIN_CIRCUIT(circ)->p_streams; conn;
conn=conn->next_stream)
if (conn->cpath_layer == layer_hint)

View File

@ -1203,6 +1203,7 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
tmpe = NULL;
}
for ( ; tmpe; tmpe=tmpe->next) {
/* XXXX012 Can this move into policies.c ? */
/* Write: "accept 1.2.3.4" */
in.s_addr = htonl(tmpe->addr);
tor_inet_ntoa(&in, addrbuf, sizeof(addrbuf));

View File

@ -679,7 +679,7 @@ routerlist_add_family(smartlist_t *sl, routerinfo_t *router)
or_options_t *options = get_options();
/* First, add any routers with similar network addresses.
* XXX It's possible this will be really expensive; we'll see. */
* XXXX012 It's possible this will be really expensive; we'll see. */
if (options->EnforceDistinctSubnets)
routerlist_add_network_family(sl, router);
@ -1031,7 +1031,7 @@ router_choose_random_node(const char *preferred,
smartlist_subtract(sl,excludedsmartlist);
routerlist_sl_remove_unreliable_routers(sl, need_uptime,
need_capacity, need_guard);
if (need_capacity) /* XXXX Is this documented in path spec. -NM */
if (need_capacity) /* XXXX012 Is this documented in path spec. -NM */
choice = routerlist_sl_choose_by_bandwidth(sl, weight_for_exit);
else
choice = smartlist_choose(sl);
@ -1871,6 +1871,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
* Hm. perhaps we should; I don't see how this code is non-broken wrt named
* routers. -NM
*/
/* XXXX012 The above is indeed implemented; remove this block. */
/* If the identity key has changed, and one of the
* routers is named, drop the unnamed ones. (If more than one are named,
@ -4264,7 +4265,7 @@ getinfo_helper_networkstatus(control_connection_t *conn,
*answer = networkstatus_getinfo_helper_single(&status->status);
} else {
*answer = tor_strdup("");
/* XXX this should return a 552, not a 250; but handle_getinfo_helper()
/* XXXX012 this should return a 552, not a 250; but handle_getinfo_helper()
* isn't set up to handle that. That should be fixed too. :) -RD */
}
return 0;

View File

@ -1387,7 +1387,7 @@ router_parse_addr_policy(directory_token_t *tok)
newe = tor_malloc_zero(sizeof(addr_policy_t));
newe->string = tor_malloc(8+strlen(arg));
/* XXX eventually, use the code from router.c:727 to generate this */
/* XXXX012 eventually, use the code from router.c:727 to generate this */
tor_snprintf(newe->string, 8+strlen(arg), "%s %s",
(tok->tp == K_REJECT) ? "reject" : "accept", arg);
newe->policy_type = (tok->tp == K_REJECT) ? ADDR_POLICY_REJECT
@ -1423,7 +1423,7 @@ policy_read_failed:
static addr_policy_t *
router_parse_private_addr_policy_private(directory_token_t *tok)
{
/* XXXX duplicated from config.c */
/* XXXX012 duplicated from config.c */
static const char *private_nets[] = {
"0.0.0.0/8", "169.254.0.0/16",
"127.0.0.0/8", "192.168.0.0/16", "10.0.0.0/8", "172.16.0.0/12",NULL };