diff options
author | Roger Dingledine <arma@torproject.org> | 2007-02-24 19:29:42 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-02-24 19:29:42 +0000 |
commit | fc81b71055b27e4109d15bc92a95f995642bba7f (patch) | |
tree | 09dc1c21c9bde3ead400b2e9b61f88eece9f42cb /src | |
parent | 988092f67482e72d0adc272979b693d9b4e55a6c (diff) | |
download | tor-fc81b71055b27e4109d15bc92a95f995642bba7f.tar.gz tor-fc81b71055b27e4109d15bc92a95f995642bba7f.zip |
if we can't read bandwidthrate, at least tell us what it was.
svn:r9640
Diffstat (limited to 'src')
-rw-r--r-- | src/or/routerparse.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 233bb3c209..bd1562e43b 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -814,10 +814,19 @@ router_parse_entry_from_string(const char *s, const char *end, } router->bandwidthrate = tor_parse_long(tok->args[0],10,0,INT_MAX,NULL,NULL); + + if (!router->bandwidthrate) { + log_warn(LD_DIR, "bandwidthrate %s unreadable or 0. Failing.", + escaped(tok->args[0])); + goto err; + } + router->bandwidthburst = tor_parse_long(tok->args[1],10,0,INT_MAX,NULL,NULL); router->bandwidthcapacity = tor_parse_long(tok->args[2],10,0,INT_MAX,NULL,NULL); + + /* XXX we don't error-check these values? -RD */ } if ((tok = find_first_by_keyword(tokens, K_UPTIME))) { @@ -953,10 +962,7 @@ router_parse_entry_from_string(const char *s, const char *end, log_warn(LD_DIR,"or_port unreadable or 0. Failing."); goto err; } - if (!router->bandwidthrate) { - log_warn(LD_DIR,"bandwidthrate unreadable or 0. Failing."); - goto err; - } + if (!router->platform) { router->platform = tor_strdup("<unknown>"); } |