Browse Source

r8851@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.


svn:r8580

Nick Mathewson 17 years ago
parent
commit
4c56ac93ca
6 changed files with 18 additions and 56 deletions
  1. 0 1
      src/common/util.c
  2. 5 11
      src/or/circuitbuild.c
  3. 9 39
      src/or/config.c
  4. 0 1
      src/or/connection.c
  5. 2 1
      src/or/control.c
  6. 2 3
      src/or/or.h

+ 0 - 1
src/common/util.c

@@ -1867,7 +1867,6 @@ get_interface_address(int severity, uint32_t *addr)
     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",

+ 5 - 11
src/or/circuitbuild.c

@@ -176,6 +176,7 @@ circuit_log_path(int severity, unsigned int domain, origin_circuit_t *circ)
  * 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 @@ circuit_rep_hist_note_result(origin_circuit_t *circ)
   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 @@ circuit_truncated(origin_circuit_t *circ, crypt_path_t *layer)
 
     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 @@ choose_good_entry_server(uint8_t purpose, cpath_build_state_t *state)
           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,

+ 9 - 39
src/or/config.c

@@ -824,12 +824,6 @@ options_act(or_options_t *old_options)
        !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 @@ is_local_IP(uint32_t ip)
   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 @@ validate_ports_csv(smartlist_t *sl, const char *name, char **msg)
   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 @@ normalize_data_directory(or_options_t *options)
    }
    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 @@ write_configuration_file(const char *fname, or_options_t *options)
     }
     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 @@ int
 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());

+ 0 - 1
src/or/connection.c

@@ -1991,7 +1991,6 @@ alloc_http_authenticator(const char *authenticator)
  * 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)
 {

+ 2 - 1
src/or/control.c

@@ -726,7 +726,8 @@ control_setconf_helper(control_connection_t *conn, uint32_t len, char *body,
     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;
     }

+ 2 - 3
src/or/or.h

@@ -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 @@ typedef enum {
 #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 @@ typedef struct or_circuit_t {
   /** 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];