[or-cvs] r9533: Resolve some XXXX012 items: - Remove PathlenCoinWeight: if w (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Feb 8 22:08:01 UTC 2007


Author: nickm
Date: 2007-02-08 17:07:56 -0500 (Thu, 08 Feb 2007)
New Revision: 9533

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuitbuild.c
   tor/trunk/src/or/config.c
   tor/trunk/src/or/connection.c
   tor/trunk/src/or/dns.c
   tor/trunk/src/or/or.h
Log:
 r11726 at catbus:  nickm | 2007-02-08 16:04:53 -0500
 Resolve some XXXX012 items:
   - Remove PathlenCoinWeight: if we want it again, we can add it
     back in.
   - Ditto with RelayBandwidth*.
   - Decide to leave in the "hey, you didn't set end_reason!" BUG log message,
     but stop telling people to bug me personally.
   - Postpone strengthening assert_connection_ok(): it's important, but 
     it's also a good way to introduce weird bugs.
   - Move some expensive consistency checking from dns_free_all() into
     assert_cache_ok().



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11726] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-02-08 20:27:58 UTC (rev 9532)
+++ tor/trunk/ChangeLog	2007-02-08 22:07:56 UTC (rev 9533)
@@ -23,6 +23,8 @@
     - Warn the user when an application uses the obsolete binary v0 control
       protocol.  We're planning to remove support for it during the next
       development series, so it's good to give people some advance warning.
+    - Remove some never-implemented options.  Mark PathlenCoinWeight as
+      obsolete.
 
 
 Changes in version 0.1.2.7-alpha - 2007-02-06

Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2007-02-08 20:27:58 UTC (rev 9532)
+++ tor/trunk/src/or/circuitbuild.c	2007-02-08 22:07:56 UTC (rev 9533)
@@ -998,14 +998,12 @@
  * is feasible, except if it's less than 2, in which case return -1.
  */
 static int
-new_route_len(double cw, uint8_t purpose, extend_info_t *exit,
+new_route_len(uint8_t purpose, extend_info_t *exit,
               smartlist_t *routers)
 {
   int num_acceptable_routers;
   int routelen;
 
-  tor_assert(cw >= 0.);
-  tor_assert(cw < 1.);
   tor_assert(routers);
 
 #ifdef TOR_PERF
@@ -1354,8 +1352,7 @@
     log_debug(LD_CIRC, "Launching a one-hop circuit for dir tunnel.");
     state->desired_path_len = 1;
   } else {
-    int r = new_route_len(get_options()->PathlenCoinWeight,
-                          circ->_base.purpose, exit, rl->routers);
+    int r = new_route_len(circ->_base.purpose, exit, rl->routers);
     if (r < 1) /* must be at least 1 */
       return -1;
     state->desired_path_len = r;

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2007-02-08 20:27:58 UTC (rev 9532)
+++ tor/trunk/src/or/config.c	2007-02-08 22:07:56 UTC (rev 9533)
@@ -207,8 +207,7 @@
   VAR("ORListenAddress",     LINELIST, ORListenAddress,      NULL),
   VAR("ORPort",              UINT,     ORPort,               "0"),
   VAR("OutboundBindAddress", STRING,   OutboundBindAddress,  NULL),
-  /* XXXX012 mark this obsolete?  Warn if it's set? */
-  VAR("PathlenCoinWeight",   DOUBLE,   PathlenCoinWeight,    "0.3"),
+  OBSOLETE("PathlenCoinWeight"),
   VAR("PidFile",             STRING,   PidFile,              NULL),
   VAR("PreferTunneledDirConns", BOOL,  PreferTunneledDirConns, "0"),
   VAR("ProtocolWarnings",    BOOL,     ProtocolWarnings,     "0"),
@@ -221,9 +220,6 @@
   VAR("RecommendedClientVersions", LINELIST, RecommendedClientVersions,  NULL),
   VAR("RecommendedServerVersions", LINELIST, RecommendedServerVersions,  NULL),
   VAR("RedirectExit",        LINELIST, RedirectExit,         NULL),
-  /* XXXX012 These aren't implemented. Take them out for now? */
-  VAR("RelayBandwidthBurst", MEMUNIT,  RelayBandwidthBurst,  "0"),
-  VAR("RelayBandwidthRate",  MEMUNIT,  RelayBandwidthRate,   "0"),
   VAR("RendExcludeNodes",    STRING,   RendExcludeNodes,     NULL),
   VAR("RendNodes",           STRING,   RendNodes,            NULL),
   VAR("RendPostPeriod",      INTERVAL, RendPostPeriod,       "1 hour"),
@@ -2611,9 +2607,11 @@
       });
   }
 
+#if 0
   if (options->SocksPort >= 1 &&
       (options->PathlenCoinWeight < 0.0 || options->PathlenCoinWeight >= 1.0))
     REJECT("PathlenCoinWeight option must be >=0.0 and <1.0.");
+#endif
 
   if (options->RendPostPeriod < MIN_REND_POST_PERIOD) {
     log(LOG_WARN,LD_CONFIG,"RendPostPeriod option must be at least %d seconds."

Modified: tor/trunk/src/or/connection.c
===================================================================
--- tor/trunk/src/or/connection.c	2007-02-08 20:27:58 UTC (rev 9532)
+++ tor/trunk/src/or/connection.c	2007-02-08 22:07:56 UTC (rev 9533)
@@ -477,9 +477,8 @@
                  conn->marked_for_close_file, conn->marked_for_close);
       }
       if (!edge_conn->end_reason) {
-        // XXXX012 Disable this before 0.1.2.x-final ships.
         log_warn(LD_BUG,"Bug: Closing stream (marked at %s:%d) without having"
-                 " set end_reason. Please tell Nick.",
+                 " set end_reason.",
                  conn->marked_for_close_file, conn->marked_for_close);
       }
       control_event_stream_status(edge_conn, STREAM_EVENT_CLOSED,
@@ -2385,7 +2384,7 @@
   if (conn->hold_open_until_flushed)
     tor_assert(conn->marked_for_close);
 
-  /* XXXX012 check: wants_to_read, wants_to_write, s, conn_array_index,
+  /* XXXX check: wants_to_read, wants_to_write, s, conn_array_index,
    * marked_for_close. */
 
   /* buffers */
@@ -2394,7 +2393,7 @@
     assert_buf_ok(conn->outbuf);
   }
 
-  /* XXXX012 Fix this; no longer so.*/
+  /* XXXX 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/dns.c
===================================================================
--- tor/trunk/src/or/dns.c	2007-02-08 20:27:58 UTC (rev 9532)
+++ tor/trunk/src/or/dns.c	2007-02-08 22:07:56 UTC (rev 9533)
@@ -320,20 +320,12 @@
 dns_free_all(void)
 {
   cached_resolve_t **ptr, **next, *item;
+  assert_cache_ok();
   if (cached_resolve_pqueue) {
     SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res,
       {
-        /* XXXX012 The hash lookups here could be quite slow; remove them
-         * once we're happy. (Leave them in for at least 0.1.2.7-alpha, so they
-         * get some testing.) -NM */
-        if (res->state == CACHE_STATE_DONE) {
-          cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res);
-          tor_assert(!found || found != res);
+        if (res->state == CACHE_STATE_DONE)
           _free_cached_resolve(res);
-        } else {
-          cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res);
-          tor_assert(found);
-        }
       });
   }
   for (ptr = HT_START(cache_map, &cache_root); ptr != NULL; ptr = next) {
@@ -2032,6 +2024,17 @@
 
   smartlist_pqueue_assert_ok(cached_resolve_pqueue,
                              _compare_cached_resolves_by_expiry);
+
+  SMARTLIST_FOREACH(cached_resolve_pqueue, cached_resolve_t *, res,
+    {
+      if (res->state == CACHE_STATE_DONE) {
+        cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res);
+        tor_assert(!found || found != res);
+      } else {
+        cached_resolve_t *found = HT_FIND(cache_map, &cache_root, res);
+        tor_assert(found);
+      }
+    });
 }
 #endif
 

Modified: tor/trunk/src/or/or.h
===================================================================
--- tor/trunk/src/or/or.h	2007-02-08 20:27:58 UTC (rev 9532)
+++ tor/trunk/src/or/or.h	2007-02-08 22:07:56 UTC (rev 9533)
@@ -1610,8 +1610,6 @@
   int DirAllowPrivateAddresses;
   char *User; /**< Name of user to run Tor as. */
   char *Group; /**< Name of group to run Tor as. */
-  double PathlenCoinWeight; /**< Parameter used to configure average path
-                             * length (alpha in geometric distribution). */
   int ORPort; /**< Port to listen on for OR connections. */
   int SocksPort; /**< Port to listen on for SOCKS connections. */
   /** Port to listen on for transparent pf/netfilter connections. */
@@ -1683,10 +1681,6 @@
                             * to use in a second? */
   uint64_t MaxAdvertisedBandwidth; /**< How much bandwidth are we willing to
                                     * tell people we have? */
-  uint64_t RelayBandwidthRate; /**< How much bandwidth, on average, are we
-                                 * willing to use for all relayed conns? */
-  uint64_t RelayBandwidthBurst; /**< How much bandwidth, at maximum, will we
-                                 * use in a second for all relayed conns? */
   int NumCpus; /**< How many CPUs should we try to use? */
   int RunTesting; /**< If true, create testing circuits to measure how well the
                    * other ORs are running. */



More information about the tor-commits mailing list