Commit 4c56ac93 authored by Nick Mathewson's avatar Nick Mathewson 🦀
Browse files

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
parent 4de9f45d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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
Original line number Diff line number Diff line
@@ -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;
    }
Loading