[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r9640: if we can't read bandwidthrate, at least tell us what it was (tor/trunk/src/or)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r9640: if we can't read bandwidthrate, at least tell us what it was (tor/trunk/src/or)
- From: arma@xxxxxxxx
- Date: Sat, 24 Feb 2007 14:29:48 -0500 (EST)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Sat, 24 Feb 2007 14:29:58 -0500
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
Author: arma
Date: 2007-02-24 14:29:42 -0500 (Sat, 24 Feb 2007)
New Revision: 9640
Modified:
tor/trunk/src/or/routerparse.c
Log:
if we can't read bandwidthrate, at least tell us what it was.
Modified: tor/trunk/src/or/routerparse.c
===================================================================
--- tor/trunk/src/or/routerparse.c 2007-02-24 19:10:35 UTC (rev 9639)
+++ tor/trunk/src/or/routerparse.c 2007-02-24 19:29:42 UTC (rev 9640)
@@ -814,10 +814,19 @@
}
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 @@
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>");
}