mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-13 06:33:44 +01:00
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:
parent
0bbbf98be4
commit
b59573949e
@ -441,15 +441,8 @@ connection_about_to_close_connection(connection_t *conn)
|
|||||||
* give up. */
|
* give up. */
|
||||||
circuit_n_conn_done(TO_OR_CONN(conn), 0);
|
circuit_n_conn_done(TO_OR_CONN(conn), 0);
|
||||||
} else if (conn->hold_open_until_flushed) {
|
} else if (conn->hold_open_until_flushed) {
|
||||||
/* XXXX009 We used to have an arg that told us whether we closed the
|
/* We only set hold_open_until_flushed when we're intentionally
|
||||||
* connection on purpose or not. Can we use hold_open_until_flushed
|
* closing a connection. */
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
rep_hist_note_disconnect(or_conn->identity_digest, now);
|
rep_hist_note_disconnect(or_conn->identity_digest, now);
|
||||||
control_event_or_conn_status(or_conn, OR_CONN_EVENT_CLOSED);
|
control_event_or_conn_status(or_conn, OR_CONN_EVENT_CLOSED);
|
||||||
} else if (or_conn->identity_digest) {
|
} 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);
|
pending = tor_tls_get_pending_bytes(or_conn->tls);
|
||||||
if (pending) {
|
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
|
* take us over our read allotment, but really we shouldn't be
|
||||||
* believing that SSL bytes are the same as TCP bytes anyway. */
|
* believing that SSL bytes are the same as TCP bytes anyway. */
|
||||||
int r2 = read_to_buf_tls(or_conn->tls, pending, conn->inbuf);
|
int r2 = read_to_buf_tls(or_conn->tls, pending, conn->inbuf);
|
||||||
@ -1715,7 +1708,7 @@ connection_handle_write(connection_t *conn)
|
|||||||
void
|
void
|
||||||
_connection_controller_force_write(control_connection_t *control_conn)
|
_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
|
* 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.
|
* 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)
|
if (conn->hold_open_until_flushed)
|
||||||
tor_assert(conn->marked_for_close);
|
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. */
|
* marked_for_close. */
|
||||||
|
|
||||||
/* buffers */
|
/* buffers */
|
||||||
@ -2305,7 +2298,7 @@ assert_connection_ok(connection_t *conn, time_t now)
|
|||||||
assert_buf_ok(conn->outbuf);
|
assert_buf_ok(conn->outbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* XXX Fix this; no longer so.*/
|
/* XXXX012 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);
|
||||||
|
@ -1289,7 +1289,7 @@ connection_ap_handshake_rewrite_and_attach(edge_connection_t *conn,
|
|||||||
/* help predict this next time */
|
/* help predict this next time */
|
||||||
rep_hist_note_used_port(socks->port, time(NULL));
|
rep_hist_note_used_port(socks->port, time(NULL));
|
||||||
} else if (socks->command == SOCKS_COMMAND_RESOLVE_PTR) {
|
} 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 */
|
rep_hist_note_used_resolve(time(NULL)); /* help predict this next time */
|
||||||
} else if (socks->command == SOCKS_COMMAND_CONNECT_DIR) {
|
} 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);
|
return connection_ap_handshake_rewrite_and_attach(conn, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** connection_edge_process_inbuf() found a conn in state
|
/** connection_edge_process_inbuf() found a conn in state natd_wait. See if
|
||||||
* natd_wait. See if conn-\>inbuf has the right bytes to proceed.
|
* conn-\>inbuf has the right bytes to proceed. See FreeBSD's libalias(3) and
|
||||||
* See libalias(3) and ProxyEncodeTcpStream() in alias_proxy.c for
|
* ProxyEncodeTcpStream() in src/lib/libalias/alias_proxy.c for the encoding
|
||||||
* the encoding form of the original destination.
|
* form of the original destination.
|
||||||
* XXX what is "alias_proxy.c"? -RD
|
|
||||||
*
|
*
|
||||||
* If the original destination is complete, send it to
|
* If the original destination is complete, send it to
|
||||||
* connection_ap_handshake_rewrite_and_attach().
|
* connection_ap_handshake_rewrite_and_attach().
|
||||||
|
@ -104,11 +104,13 @@ connection_or_set_identity_digest(or_connection_t *conn, const char *digest)
|
|||||||
tmp = digestmap_set(orconn_identity_map, digest, conn);
|
tmp = digestmap_set(orconn_identity_map, digest, conn);
|
||||||
conn->next_with_same_id = tmp;
|
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) {
|
for (; tmp; tmp = tmp->next_with_same_id) {
|
||||||
tor_assert(!memcmp(tmp->identity_digest, digest, DIGEST_LEN));
|
tor_assert(!memcmp(tmp->identity_digest, digest, DIGEST_LEN));
|
||||||
tor_assert(tmp != conn);
|
tor_assert(tmp != conn);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Pack the cell_t host-order structure <b>src</b> into network-order
|
/** Pack the cell_t host-order structure <b>src</b> into network-order
|
||||||
|
@ -359,7 +359,7 @@ connection_dir_download_routerdesc_failed(dir_connection_t *conn)
|
|||||||
* it's not their fault.*/
|
* it's not their fault.*/
|
||||||
/* update_router_descriptor_downloads(time(NULL)); */
|
/* update_router_descriptor_downloads(time(NULL)); */
|
||||||
(void) conn;
|
(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
|
/** Helper for directory_initiate_command_(router|trusted_dir): send the
|
||||||
@ -1307,7 +1307,7 @@ connection_dir_process_inbuf(dir_connection_t *conn)
|
|||||||
return 0;
|
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)
|
if (!conn->_base.inbuf_reached_eof)
|
||||||
log_debug(LD_HTTP,"Got data, not eof. Leaving on inbuf.");
|
log_debug(LD_HTTP,"Got data, not eof. Leaving on inbuf.");
|
||||||
|
@ -1610,7 +1610,7 @@ generate_v2_networkstatus(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* DOCDOC */
|
/* 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
|
void
|
||||||
dirserv_get_networkstatus_v2_fingerprints(smartlist_t *result,
|
dirserv_get_networkstatus_v2_fingerprints(smartlist_t *result,
|
||||||
const char *key)
|
const char *key)
|
||||||
@ -1858,7 +1858,7 @@ dirserv_orconn_tls_done(const char *address,
|
|||||||
tor_assert(address);
|
tor_assert(address);
|
||||||
tor_assert(digest_rcvd);
|
tor_assert(digest_rcvd);
|
||||||
tor_assert(nickname_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 We should really have a better solution here than dropping
|
||||||
// XXXXNM whole routers; otherwise, they come back way too easily.
|
// XXXXNM whole routers; otherwise, they come back way too easily.
|
||||||
@ -1867,7 +1867,8 @@ dirserv_orconn_tls_done(const char *address,
|
|||||||
int drop = 0;
|
int drop = 0;
|
||||||
if (strcasecmp(address, ri->address) || or_port != ri->or_port)
|
if (strcasecmp(address, ri->address) || or_port != ri->or_port)
|
||||||
continue;
|
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) {
|
if (!ri->is_valid) {
|
||||||
/* We have a router at the same address! */
|
/* We have a router at the same address! */
|
||||||
if (strcasecmp(ri->nickname, nickname_rcvd)) {
|
if (strcasecmp(ri->nickname, nickname_rcvd)) {
|
||||||
|
@ -798,7 +798,7 @@ reply_parse(u8 *packet, int length) {
|
|||||||
|
|
||||||
req = request_find_from_trans_id(trans_id);
|
req = request_find_from_trans_id(trans_id);
|
||||||
if (!req) return -1;
|
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));
|
memset(&reply, 0, sizeof(reply));
|
||||||
|
|
||||||
|
@ -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 */
|
cell->circ_id = TO_OR_CIRCUIT(circ)->p_circ_id; /* switch it */
|
||||||
or_conn = TO_OR_CIRCUIT(circ)->p_conn;
|
or_conn = TO_OR_CIRCUIT(circ)->p_conn;
|
||||||
} else {
|
} else {
|
||||||
// XXXX NM WARN.
|
log_fn(LOG_PROTOCOL_WARN, LD_OR,
|
||||||
|
"Dropping unrecognized inbound cell on origin circuit.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1395,12 +1396,6 @@ circuit_consider_stop_edge_reading(circuit_t *circ, crypt_path_t *layer_hint)
|
|||||||
layer_hint->package_window);
|
layer_hint->package_window);
|
||||||
if (layer_hint->package_window <= 0) {
|
if (layer_hint->package_window <= 0) {
|
||||||
log_debug(domain,"yes, at-origin. stopped.");
|
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;
|
for (conn = TO_ORIGIN_CIRCUIT(circ)->p_streams; conn;
|
||||||
conn=conn->next_stream)
|
conn=conn->next_stream)
|
||||||
if (conn->cpath_layer == layer_hint)
|
if (conn->cpath_layer == layer_hint)
|
||||||
|
@ -1203,6 +1203,7 @@ router_dump_router_to_string(char *s, size_t maxlen, routerinfo_t *router,
|
|||||||
tmpe = NULL;
|
tmpe = NULL;
|
||||||
}
|
}
|
||||||
for ( ; tmpe; tmpe=tmpe->next) {
|
for ( ; tmpe; tmpe=tmpe->next) {
|
||||||
|
/* XXXX012 Can this move into policies.c ? */
|
||||||
/* Write: "accept 1.2.3.4" */
|
/* Write: "accept 1.2.3.4" */
|
||||||
in.s_addr = htonl(tmpe->addr);
|
in.s_addr = htonl(tmpe->addr);
|
||||||
tor_inet_ntoa(&in, addrbuf, sizeof(addrbuf));
|
tor_inet_ntoa(&in, addrbuf, sizeof(addrbuf));
|
||||||
|
@ -679,7 +679,7 @@ routerlist_add_family(smartlist_t *sl, routerinfo_t *router)
|
|||||||
or_options_t *options = get_options();
|
or_options_t *options = get_options();
|
||||||
|
|
||||||
/* First, add any routers with similar network addresses.
|
/* 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)
|
if (options->EnforceDistinctSubnets)
|
||||||
routerlist_add_network_family(sl, router);
|
routerlist_add_network_family(sl, router);
|
||||||
|
|
||||||
@ -1031,7 +1031,7 @@ router_choose_random_node(const char *preferred,
|
|||||||
smartlist_subtract(sl,excludedsmartlist);
|
smartlist_subtract(sl,excludedsmartlist);
|
||||||
routerlist_sl_remove_unreliable_routers(sl, need_uptime,
|
routerlist_sl_remove_unreliable_routers(sl, need_uptime,
|
||||||
need_capacity, need_guard);
|
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);
|
choice = routerlist_sl_choose_by_bandwidth(sl, weight_for_exit);
|
||||||
else
|
else
|
||||||
choice = smartlist_choose(sl);
|
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
|
* Hm. perhaps we should; I don't see how this code is non-broken wrt named
|
||||||
* routers. -NM
|
* routers. -NM
|
||||||
*/
|
*/
|
||||||
|
/* XXXX012 The above is indeed implemented; remove this block. */
|
||||||
|
|
||||||
/* If the identity key has changed, and one of the
|
/* If the identity key has changed, and one of the
|
||||||
* routers is named, drop the unnamed ones. (If more than one are named,
|
* 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);
|
*answer = networkstatus_getinfo_helper_single(&status->status);
|
||||||
} else {
|
} else {
|
||||||
*answer = tor_strdup("");
|
*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 */
|
* isn't set up to handle that. That should be fixed too. :) -RD */
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1387,7 +1387,7 @@ router_parse_addr_policy(directory_token_t *tok)
|
|||||||
newe = tor_malloc_zero(sizeof(addr_policy_t));
|
newe = tor_malloc_zero(sizeof(addr_policy_t));
|
||||||
|
|
||||||
newe->string = tor_malloc(8+strlen(arg));
|
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",
|
tor_snprintf(newe->string, 8+strlen(arg), "%s %s",
|
||||||
(tok->tp == K_REJECT) ? "reject" : "accept", arg);
|
(tok->tp == K_REJECT) ? "reject" : "accept", arg);
|
||||||
newe->policy_type = (tok->tp == K_REJECT) ? ADDR_POLICY_REJECT
|
newe->policy_type = (tok->tp == K_REJECT) ? ADDR_POLICY_REJECT
|
||||||
@ -1423,7 +1423,7 @@ policy_read_failed:
|
|||||||
static addr_policy_t *
|
static addr_policy_t *
|
||||||
router_parse_private_addr_policy_private(directory_token_t *tok)
|
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[] = {
|
static const char *private_nets[] = {
|
||||||
"0.0.0.0/8", "169.254.0.0/16",
|
"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 };
|
"127.0.0.0/8", "192.168.0.0/16", "10.0.0.0/8", "172.16.0.0/12",NULL };
|
||||||
|
Loading…
Reference in New Issue
Block a user