[or-cvs] various tweaks and fixes

Roger Dingledine arma at seul.org
Sat Oct 16 22:56:49 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	circuitbuild.c circuitlist.c config.c or.h 
Log Message:
various tweaks and fixes


Index: circuitbuild.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitbuild.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- circuitbuild.c	16 Oct 2004 22:14:51 -0000	1.40
+++ circuitbuild.c	16 Oct 2004 22:56:46 -0000	1.41
@@ -979,11 +979,9 @@
       r = router_choose_random_node(options.RendNodes, options.RendExcludeNodes,
           NULL, 0, 1, options._AllowUnverified & ALLOW_UNVERIFIED_RENDEZVOUS, 0);
       return r;
-    default:
-      log_fn(LOG_WARN,"unhandled purpose %d", purpose);
-      tor_assert(0);
   }
-  return NULL; /* never reached */
+  log_fn(LOG_WARN,"Unhandled purpose %d", purpose);
+  return NULL;
 }
 
 /** Allocate a cpath_build_state_t, populate it based on

Index: circuitlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/circuitlist.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- circuitlist.c	11 Oct 2004 01:17:42 -0000	1.11
+++ circuitlist.c	16 Oct 2004 22:56:46 -0000	1.12
@@ -411,7 +411,7 @@
       tor_assert(cp->handshake_state);
       break;
     default:
-      log_fn(LOG_WARN,"Unexpected state %d",cp->state);
+      log_fn(LOG_ERR,"Unexpected state %d",cp->state);
       tor_assert(0);
     }
   tor_assert(cp->package_window >= 0);

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.177
retrieving revision 1.178
diff -u -d -r1.177 -r1.178
--- config.c	16 Oct 2004 22:37:08 -0000	1.177
+++ config.c	16 Oct 2004 22:56:46 -0000	1.178
@@ -35,6 +35,8 @@
 static int config_compare(struct config_line_t *c, const char *key, config_type_t type, void *arg);
 static int config_assign(or_options_t *options, struct config_line_t *list);
 static int parse_dir_server_line(const char *line);
+static int parse_redirect_line(or_options_t *options,
+                               struct config_line_t *line);
 
 /** Helper: Read a list of configuration options from the command line. */
 static struct config_line_t *
@@ -481,9 +483,9 @@
   config_free_lines(options->NodeFamilies);
   config_free_lines(options->RedirectExit);
   if (options->RedirectExitList) {
-    SMARTLIST_FOREACH(options->RedirectExit,exit_redirect_t *, p, tor_free(p));
-    smartlist_free(options->RedirectExit);
-    options->RedirectExit = NULL;                      
+    SMARTLIST_FOREACH(options->RedirectExitList,exit_redirect_t *, p, tor_free(p));
+    smartlist_free(options->RedirectExitList);
+    options->RedirectExitList = NULL;
   }
   if (options->FirewallPorts) {
     SMARTLIST_FOREACH(options->FirewallPorts, char *, cp, tor_free(cp));
@@ -1065,7 +1067,7 @@
   }
 }
 
-static int parse_redirect_line(or_options_t *options, 
+static int parse_redirect_line(or_options_t *options,
                                struct config_line_t *line)
 {
   smartlist_t *elements = NULL;

Index: or.h
===================================================================
RCS file: /home/or/cvsroot/src/or/or.h,v
retrieving revision 1.438
retrieving revision 1.439
diff -u -d -r1.438 -r1.439
--- or.h	16 Oct 2004 22:37:08 -0000	1.438
+++ or.h	16 Oct 2004 22:56:46 -0000	1.439
@@ -825,7 +825,7 @@
   uint16_t port_max;
 
   uint32_t addr_dest;
-  uint32_t port_dest;
+  uint16_t port_dest;
 } exit_redirect_t;
 
 /** Configuration options for a Tor process */
@@ -917,7 +917,7 @@
                                        * node families */
   struct config_line_t *RedirectExit; /**< List of config lines for simple
                                        * addr/port redirection */
-  smartlist_t *RedirectExitList; /** List of exit_redirect_t */
+  smartlist_t *RedirectExitList; /**< List of exit_redirect_t */
 } or_options_t;
 
 /* XXX are these good enough defaults? */



More information about the tor-commits mailing list