[or-cvs] Remove code that has been #if-0ed for a long time.

Nick Mathewson nickm at seul.org
Wed Jun 15 18:34:48 UTC 2005


Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv10977/src/or

Modified Files:
	circuitbuild.c config.c connection.c connection_edge.c 
	dirserv.c or.h rephist.c routerparse.c 
Log Message:
Remove code that has been #if-0ed for a long time.

Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/circuitbuild.c,v
retrieving revision 1.119
retrieving revision 1.120
diff -u -d -r1.119 -r1.120
--- circuitbuild.c	11 Jun 2005 21:17:38 -0000	1.119
+++ circuitbuild.c	15 Jun 2005 18:34:46 -0000	1.120
@@ -900,12 +900,6 @@
     return -1;
   }
 #endif
-#if 0
-  for (routelen = 3; ; routelen++) { /* 3, increment until coinflip says we're done */
-    if (crypto_pseudo_rand_int(255) >= cw*255) /* don't extend */
-      break;
-  }
-#endif
   log_fn(LOG_DEBUG,"Chosen route length %d (%d routers available).",routelen,
          smartlist_len(routers));
 

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.363
retrieving revision 1.364
diff -u -d -r1.363 -r1.364
--- config.c	13 Jun 2005 00:35:19 -0000	1.363
+++ config.c	15 Jun 2005 18:34:46 -0000	1.364
@@ -285,9 +285,6 @@
   or_options_t *options = get_options();
   static int libevent_initialized = 0;
 
-  /* XXXX009 We once had a reason to separate start_daemon and finish_daemon:
-   *    It let us have the parent process stick around until we were sure Tor
-   *    was started.  Should we make start_daemon get called earlier? -NM */
   if (options->RunAsDaemon) {
     start_daemon();
   }
@@ -396,18 +393,6 @@
     return -1;
   }
 
-#if 0
-  {
-    char *smin, *smax;
-    smin = config_dump_options(options, 1);
-    smax = config_dump_options(options, 0);
-    log_fn(LOG_DEBUG, "These are our options:\n%s",smax);
-    log_fn(LOG_DEBUG, "We changed these options:\n%s",smin);
-    tor_free(smin);
-    tor_free(smax);
-  }
-#endif
-
   /* Since our options changed, we might need to regenerate and upload our
    * server descriptor.  (We could probably be more clever about only calling
    * this when something significant changed.)
@@ -1502,11 +1487,6 @@
     log(LOG_WARN,"BandwidthBurst must be at least equal to BandwidthRate.");
     result = -1;
   }
-#if 0
-  if (2*options->BandwidthRate > options->BandwidthBurst) {
-    log(LOG_NOTICE,"You have chosen a BandwidthBurst less than twice BandwidthRate. Please consider setting your BandwidthBurst higher (at least %d), to provide better service to the Tor network.", (int)(2*options->BandwidthRate));
-  }
-#endif
 
   if (options->_MonthlyAccountingStart) {
     if (options->AccountingStart) {
@@ -2437,12 +2417,6 @@
     log_fn(LOG_ERR, "DataDirectory is too long.");
     return -1;
   }
-#if 0
-  if (check_private_dir(options->DataDirectory, CPD_CHECK != 0)) {
-    log_fn(LOG_WARN, "Can't create directory %s", options->DataDirectory);
-    return -1;
-  }
-#endif
   return 0;
 }
 

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.378
retrieving revision 1.379
diff -u -d -r1.378 -r1.379
--- connection.c	11 Jun 2005 18:52:11 -0000	1.378
+++ connection.c	15 Jun 2005 18:34:46 -0000	1.379
@@ -1792,13 +1792,6 @@
     assert_buf_ok(conn->outbuf);
   }
 
-#if 0 /* computers often go back in time; no way to know */
-  tor_assert(!now || conn->timestamp_lastread <= now);
-  tor_assert(!now || conn->timestamp_lastwritten <= now);
-  tor_assert(conn->timestamp_created <= conn->timestamp_lastread);
-  tor_assert(conn->timestamp_created <= conn->timestamp_lastwritten);
-#endif
-
   /* XXX Fix this; no longer so.*/
 #if 0
   if (conn->type != CONN_TYPE_OR && conn->type != CONN_TYPE_DIR)

Index: connection_edge.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection_edge.c,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -d -r1.331 -r1.332
--- connection_edge.c	11 Jun 2005 18:52:11 -0000	1.331
+++ connection_edge.c	15 Jun 2005 18:34:46 -0000	1.332
@@ -810,6 +810,7 @@
 
 #if 0
   {
+    /* Try to catch possible bugs */
     addressmap_entry_t *ent;
     ent = strmap_get(addressmap, *addrp);
     tor_assert(ent);

Index: dirserv.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dirserv.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -u -d -r1.167 -r1.168
--- dirserv.c	11 Jun 2005 18:52:11 -0000	1.167
+++ dirserv.c	15 Jun 2005 18:34:46 -0000	1.168
@@ -211,22 +211,6 @@
   return NULL;
 }
 
-#if 0
-/** Return true iff any router named <b>nickname</b> with <b>digest</b>
- * is in the verified fingerprint list. */
-static int
-router_nickname_is_approved(const char *nickname, const char *digest)
-{
-  const char *n;
-
-  n = dirserv_get_nickname_by_digest(digest);
-  if (n && !strcasecmp(n,nickname))
-    return 1;
-  else
-    return 0;
-}
-#endif
-
 /** Clear the current fingerprint list. */
 void
 dirserv_free_fingerprint_list()

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/or.h,v
retrieving revision 1.615
retrieving revision 1.616
diff -u -d -r1.615 -r1.616
--- or.h	11 Jun 2005 06:07:22 -0000	1.615
+++ or.h	15 Jun 2005 18:34:46 -0000	1.616
@@ -251,10 +251,6 @@
 /** State for an exit connection: waiting to be removed. */
 #define EXIT_CONN_STATE_RESOLVEFAILED 4
 #define _EXIT_CONN_STATE_MAX 4
-#if 0
-#define EXIT_CONN_STATE_CLOSE 3 /* flushing the buffer, then will close */
-#define EXIT_CONN_STATE_CLOSE_WAIT 4 /* have sent a destroy, awaiting a confirmation */
-#endif
 
 /* the AP state values must be disjoint from the EXIT state values */
 #define _AP_CONN_STATE_MIN 5

Index: rephist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/rephist.c,v
retrieving revision 1.59
retrieving revision 1.60
diff -u -d -r1.59 -r1.60
--- rephist.c	11 Jun 2005 18:52:11 -0000	1.59
+++ rephist.c	15 Jun 2005 18:34:46 -0000	1.60
@@ -378,44 +378,6 @@
   }
 }
 
-#if 0
-void
-write_rep_history(const char *filename)
-{
-  FILE *f = NULL;
-  char *tmpfile;
-  int completed = 0;
-  or_history_t *or_history;
-  link_history_t *link_history;
-  strmap_iter_t *lhist_it;
-  strmap_iter_t *orhist_it;
-  void *or_history_p, *link_history_p;
-  const char *name1;
-
-  tmpfile = tor_malloc(strlen(filename)+5);
-  tor_snprintf(tmpfile, strlen(filename)+5, "%s_tmp", filename);
-
-  f = fopen(tmpfile, "w");
-  if (!f) goto done;
-  for (orhist_it = strmap_iter_init(history_map); !strmap_iter_done(orhist_it);
-       orhist_it = strmap_iter_next(history_map,orhist_it)) {
-    strmap_iter_get(orhist_it, &name1, &or_history_p);
-    or_history = (or_history_t*) or_history_p;
-    fprintf(f, "link %s connected:u%ld failed:%uld uptime:%uld",
-            name1, or_history->since1,
-  }
-
- done:
-  if (f)
-    fclose(f);
-  if (completed)
-    replace_file(filename, tmpfile);
-  else
-    unlink(tmpfile);
-  tor_free(tmpfile);
-}
-#endif
-
 #define NUM_SECS_ROLLING_MEASURE 10
 #define NUM_SECS_BW_SUM_IS_VALID (24*60*60) /* one day */
 #define NUM_SECS_BW_SUM_INTERVAL (15*60)

Index: routerparse.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerparse.c,v
retrieving revision 1.113
retrieving revision 1.114
diff -u -d -r1.113 -r1.114
--- routerparse.c	11 Jun 2005 18:52:11 -0000	1.113
+++ routerparse.c	15 Jun 2005 18:34:46 -0000	1.114
@@ -1389,27 +1389,6 @@
 
  done_tokenizing:
 
-#if 0
-  for (i = 0; token_table[i].t ; ++i) {
-    if (token_table[i].v == tok->tp) {
-      fputs(token_table[i].t, stdout);
-      break;
-      i = -1;
-    }
-  }
-  if (i) {
-    if (tok->tp == _UNRECOGNIZED) fputs("UNRECOGNIZED", stdout);
-    if (tok->tp == _ERR) fputs("ERR",stdout);
-    if (tok->tp == _EOF) fputs("EOF",stdout);
-    if (tok->tp == _NIL) fputs("_NIL",stdout);
-  }
-  for (i = 0; i < tok->n_args; ++i) {
-    fprintf(stdout," \"%s\"", tok->args[i]);
-  }
-  if (tok->error) { fprintf(stdout," *%s*", tok->error); }
-  fputs("\n",stdout);
-#endif
-
   return tok;
 #undef RET_ERR
 }



More information about the tor-commits mailing list