[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9205: Mark a pile of XXXX comments as targetted for 0.1.2: some be (in tor/trunk: . src/or)



Author: nickm
Date: 2006-12-28 21:47:51 -0500 (Thu, 28 Dec 2006)
New Revision: 9205

Modified:
   tor/trunk/
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/connection_edge.c
   tor/trunk/src/or/connection_or.c
   tor/trunk/src/or/directory.c
   tor/trunk/src/or/dirserv.c
   tor/trunk/src/or/eventdns.c
   tor/trunk/src/or/relay.c
   tor/trunk/src/or/router.c
   tor/trunk/src/or/routerlist.c
   tor/trunk/src/or/routerparse.c
Log:
 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11736] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/connection.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -441,15 +441,8 @@
          * 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 @@
     }
     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 @@
 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 @@
   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_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);

Modified: tor/trunk/src/or/connection_edge.c
===================================================================
--- tor/trunk/src/or/connection_edge.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/connection_edge.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -1289,7 +1289,7 @@
       /* 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 @@
   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().

Modified: tor/trunk/src/or/connection_or.c
===================================================================
--- tor/trunk/src/or/connection_or.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/connection_or.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -104,11 +104,13 @@
   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

Modified: tor/trunk/src/or/directory.c
===================================================================
--- tor/trunk/src/or/directory.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/directory.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -359,7 +359,7 @@
    * 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 @@
     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.");

Modified: tor/trunk/src/or/dirserv.c
===================================================================
--- tor/trunk/src/or/dirserv.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/dirserv.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -1610,7 +1610,7 @@
 }
 
 /* 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 @@
   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 @@
     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)) {

Modified: tor/trunk/src/or/eventdns.c
===================================================================
--- tor/trunk/src/or/eventdns.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/eventdns.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -798,7 +798,7 @@
 
 	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));
 

Modified: tor/trunk/src/or/relay.c
===================================================================
--- tor/trunk/src/or/relay.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/relay.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -195,7 +195,8 @@
     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 @@
             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)

Modified: tor/trunk/src/or/router.c
===================================================================
--- tor/trunk/src/or/router.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/router.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -1203,6 +1203,7 @@
     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));

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/routerlist.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -679,7 +679,7 @@
   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 @@
       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 @@
    * 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 @@
     *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;

Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c	2006-12-29 01:01:14 UTC (rev 9204)
+++ tor/trunk/src/or/routerparse.c	2006-12-29 02:47:51 UTC (rev 9205)
@@ -1387,7 +1387,7 @@
   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 @@
 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 };