aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-10-16 22:56:46 +0000
committerRoger Dingledine <arma@torproject.org>2004-10-16 22:56:46 +0000
commit7c3ab346f65f1f26ea32193ec5989d6bee003e62 (patch)
tree7863ef194ff7b80a8621ac542137e55455157c42 /src
parente9e9a258815db3c50c4581d7a1a9d27a45fb058b (diff)
downloadtor-7c3ab346f65f1f26ea32193ec5989d6bee003e62.tar
tor-7c3ab346f65f1f26ea32193ec5989d6bee003e62.tar.gz
various tweaks and fixes
svn:r2548
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c6
-rw-r--r--src/or/circuitlist.c2
-rw-r--r--src/or/config.c10
-rw-r--r--src/or/or.h4
4 files changed, 11 insertions, 11 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index c5d16d270..3aa7e797b 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -979,11 +979,9 @@ static routerinfo_t *choose_good_exit_server(uint8_t purpose, routerlist_t *dir)
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
diff --git a/src/or/circuitlist.c b/src/or/circuitlist.c
index 76e3be925..d151cb03f 100644
--- a/src/or/circuitlist.c
+++ b/src/or/circuitlist.c
@@ -411,7 +411,7 @@ void assert_cpath_layer_ok(const crypt_path_t *cp)
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);
diff --git a/src/or/config.c b/src/or/config.c
index 91337515d..21d8e6fba 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -35,6 +35,8 @@ static void config_free_lines(struct config_line_t *front);
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 @@ free_options(or_options_t *options)
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 @@ void exit_policy_free(struct exit_policy_t *p) {
}
}
-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;
diff --git a/src/or/or.h b/src/or/or.h
index 2193a853c..65fea556a 100644
--- a/src/or/or.h
+++ b/src/or/or.h
@@ -825,7 +825,7 @@ typedef struct exit_redirect_t {
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 @@ typedef struct {
* 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? */