[or-cvs] r8580: Remove/clarify some XXXs for no longer being accurate; for b (in tor/trunk: . src/common src/or)

nickm at seul.org nickm at seul.org
Mon Oct 2 22:13:43 UTC 2006


Author: nickm
Date: 2006-10-02 18:13:42 -0400 (Mon, 02 Oct 2006)
New Revision: 8580

Modified:
   tor/trunk/
   tor/trunk/src/common/util.c
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/config.c
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/control.c
   tor/trunk/src/or/or.h
Log:
 r8851 at totoro:  nickm | 2006-10-02 18:13:27 -0400
 Remove/clarify some XXXs for no longer being accurate; for begin things we do not indend to fix; for already being parts of big todo issues (like "/* XXX ipv6 */"); etc. Also fix some spaces.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r8851] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/src/common/util.c
===================================================================
--- tor/trunk/src/common/util.c	2006-10-02 22:13:37 UTC (rev 8579)
+++ tor/trunk/src/common/util.c	2006-10-02 22:13:42 UTC (rev 8580)
@@ -1867,7 +1867,6 @@
     goto err;
   }
 
-  /* XXXX Can this be right on IPv6 clients? */
   if (getsockname(sock, (struct sockaddr*)&my_addr, &my_addr_len)) {
     int e = tor_socket_errno(sock);
     log_fn(severity, LD_NET, "getsockname() to determine interface failed: %s",

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2006-10-02 22:13:37 UTC (rev 8579)
+++ tor/trunk/src/or/circuitbuild.c	2006-10-02 22:13:42 UTC (rev 8580)
@@ -176,6 +176,7 @@
  * extended; the _first_ hop that isn't open (if any) is marked as
  * unable to extend.
  */
+/* XXXX Someday we should learn from or circuits too. */
 void
 circuit_rep_hist_note_result(origin_circuit_t *circ)
 {
@@ -183,14 +184,8 @@
   char *prev_digest = NULL;
   routerinfo_t *router;
   hop = circ->cpath;
-  if (!hop) {
-    /* XXX
-     * if !hop, then we're not the beginning of this circuit.
-     * for now, just forget about it. later, we should remember when
-     * extends-through-us failed, too.
-     */
+  if (!hop) /* circuit hasn't started building yet. */
     return;
-  }
   if (server_mode(get_options())) {
     routerinfo_t *me = router_get_my_routerinfo();
     if (!me)
@@ -865,8 +860,8 @@
 
     for (stream = circ->p_streams; stream; stream=stream->next_stream) {
       if (stream->cpath_layer == victim) {
-        /* XXXX NM LD_CIRC? */
-        log_info(LD_APP, "Marking stream %d for close.", stream->stream_id);
+        log_info(LD_APP, "Marking stream %d for close because of truncate.",
+                 stream->stream_id);
         /* no need to send 'end' relay cells,
          * because the other side's already dead
          */
@@ -1564,8 +1559,7 @@
           smartlist_add(excluded, r);
       });
   }
-  // XXX we should exclude busy exit nodes here, too,
-  // but only if there are enough other nodes available.
+
   choice = router_choose_random_node(
            NULL, options->ExcludeNodes,
            excluded, state ? state->need_uptime : 0,

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2006-10-02 22:13:37 UTC (rev 8579)
+++ tor/trunk/src/or/config.c	2006-10-02 22:13:42 UTC (rev 8580)
@@ -824,12 +824,6 @@
        !opt_streq(old_options->EntryNodes, options->EntryNodes)))
     entry_nodes_should_be_added();
 
-  /* If the user wants to avoid certain nodes, make sure none of them
-   * are already entryguards */
-  if (options->ExcludeNodes) {
-    // XXX TODO
-  }
-
   /* Since our options changed, we might need to regenerate and upload our
    * server descriptor.
    */
@@ -1749,7 +1743,6 @@
   return 0;
 }
 
-
 /** Called when we don't have a nickname set.  Try to guess a good nickname
  * based on the hostname, and return it in a newly allocated string. If we
  * can't, return NULL and let the caller warn if it wants to. */
@@ -2028,33 +2021,6 @@
   return 0;
 }
 
-#if 0
-/* XXXX Unused. */
-/** Return 0 if every element of sl is a string holding an IP address, or if sl
- * is NULL.  Otherwise set *msg and return -1. */
-static int
-validate_ips_csv(smartlist_t *sl, const char *name, char **msg)
-{
-  char buf[1024];
-  tor_assert(name);
-
-  if (!sl)
-    return 0;
-
-  SMARTLIST_FOREACH(sl, const char *, cp,
-  {
-    struct in_addr in;
-    if (0 == tor_inet_aton(cp, &in)) {
-      int r = tor_snprintf(buf, sizeof(buf),
-                        "Malformed address '%s' out of range in %s", cp, name);
-      *msg = tor_strdup(r >= 0 ? buf : "internal error");
-      return -1;
-    }
-  });
-  return 0;
-}
-#endif
-
 /** Lowest allowable value for RendPostPeriod; if this is too low, hidden
  * services can overload the directory system. */
 #define MIN_REND_POST_PERIOD (5*60)
@@ -3399,7 +3365,8 @@
    }
    if (!options->DataDirectory && !strcmp(fn,"/.tor")) {
      /* If our homedir is /, we probably don't want to use it. */
-     /* XXXX Default to /var/lib/tor? */
+     /* Default to LOCALSTATEDIR/tor which is probably closer to what we
+      * want. */
      log_warn(LD_CONFIG,
               "Default DataDirectory is \"~/.tor\".  This expands to "
               "\"%s\", which is probably not what you want.  Using \"%s/tor\" "
@@ -3498,7 +3465,8 @@
     }
     log_notice(LD_CONFIG, "Renaming old configuration file to \"%s\"", fn_tmp);
     if (rename(fname, fn_tmp) < 0) {
-      log_warn(LD_FS, "Couldn't rename configuration file \"%s\" to \"%s\": %s",
+      log_warn(LD_FS,
+             "Couldn't rename configuration file \"%s\" to \"%s\": %s",
              fname, fn_tmp, strerror(errno));
       tor_free(fn_tmp);
       goto err;
@@ -3527,9 +3495,11 @@
 options_save_current(void)
 {
   if (torrc_fname) {
-    /* XXX This fails if we can't write to our configuration file.
-     *   Arguably, we should try falling back to datadirectory or something.
-     *   But just as arguably, we shouldn't. */
+    /* This fails if we can't write to our configuration file.
+     *
+     * If we try falling back to datadirectory or something, we have a better
+     * chance of saving the configuration, but a better chance of doing
+     * something the user never expected. Let's just warn instead. */
     return write_configuration_file(torrc_fname, get_options());
   }
   return write_configuration_file(get_default_conf_file(), get_options());

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2006-10-02 22:13:37 UTC (rev 8579)
+++ tor/trunk/src/or/connection.c	2006-10-02 22:13:42 UTC (rev 8580)
@@ -1991,7 +1991,6 @@
  * whether our address has changed and we need to generate keys.  If we do,
  * call init_keys().
  */
-/* XXXX Handle IPv6, eventually. */
 static void
 client_check_address_changed(int sock)
 {

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-10-02 22:13:37 UTC (rev 8579)
+++ tor/trunk/src/or/control.c	2006-10-02 22:13:42 UTC (rev 8580)
@@ -726,7 +726,8 @@
     tor_free(config);
   } else {
     if (config_get_lines(body, &lines) < 0) {
-      log_warn(LD_CONTROL,"V0 controller gave us config lines we can't parse.");
+      log_warn(LD_CONTROL,
+               "V0 controller gave us config lines we can't parse.");
       send_control0_error(conn, ERR_SYNTAX, "Couldn't parse configuration");
       return 0;
     }

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2006-10-02 22:13:37 UTC (rev 8579)
+++ tor/trunk/src/or/or.h	2006-10-02 22:13:42 UTC (rev 8580)
@@ -128,7 +128,6 @@
 #include "../common/torgzip.h"
 
 /* These signals are defined to help control_signal_act work.
- * XXXX Move into compat.h ?
  */
 #ifndef SIGHUP
 #define SIGHUP 1
@@ -491,7 +490,7 @@
 #define RESOLVED_TYPE_ERROR_TRANSIENT 0xF0
 #define RESOLVED_TYPE_ERROR 0xF1
 
-/* XXX We should document the meaning of these. */
+/* DOCDOC We should document the meaning of these. */
 #define END_CIRC_AT_ORIGIN           -1
 #define _END_CIRC_REASON_MIN            0
 #define END_CIRC_REASON_NONE            0
@@ -1306,7 +1305,7 @@
   /** A hash of location-hidden service's PK if purpose is INTRO_POINT, or a
    * rendezvous cookie if purpose is REND_POINT_WAITING. Filled with zeroes
    * otherwise.
-   * ???? move to a subtype or adjunct structure? Wastes 20 bytes. -NM 
+   * ???? move to a subtype or adjunct structure? Wastes 20 bytes. -NM
    */
   char rend_token[REND_TOKEN_LEN];
 



More information about the tor-commits mailing list