[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] if a router claim huge bandwidth, don"t believe it
Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or
Modified Files:
config.c routerlist.c
Log Message:
if a router claim huge bandwidth, don't believe it
Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- config.c 16 Aug 2004 20:47:00 -0000 1.135
+++ config.c 17 Aug 2004 02:00:36 -0000 1.136
@@ -130,7 +130,7 @@
/**
* Given a list of comma-separated entries, each surrounded by optional
- * whitespace, insert copies the entries (in order) into lst, without
+ * whitespace, insert copies of the entries (in order) into lst, without
* their surrounding whitespace.
*/
static void parse_csv_into_smartlist(smartlist_t *lst, const char *val)
Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routerlist.c,v
retrieving revision 1.121
retrieving revision 1.122
diff -u -d -r1.121 -r1.122
--- routerlist.c 16 Aug 2004 20:47:00 -0000 1.121
+++ routerlist.c 17 Aug 2004 02:00:36 -0000 1.122
@@ -250,6 +250,8 @@
/* give capacity a default, until 0.0.7 is obsolete */
tmp = (router->bandwidthcapacity == 0) ? 200000 : router->bandwidthcapacity;
this_bw = (tmp < router->bandwidthrate) ? tmp : router->bandwidthrate;
+ if(this_bw > 800000)
+ this_bw = 800000; /* if they claim something huge, don't believe it */
p = tor_malloc(sizeof(uint32_t));
*p = this_bw;
smartlist_add(bandwidths, p);