mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
if a router claim huge bandwidth, don't believe it
svn:r2245
This commit is contained in:
parent
0b91fd1cbe
commit
76eadc6f0a
@ -130,7 +130,7 @@ static void config_free_lines(struct config_line_t *front) {
|
||||
|
||||
/**
|
||||
* 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)
|
||||
|
@ -250,6 +250,8 @@ routerlist_sl_choose_by_bandwidth(smartlist_t *sl)
|
||||
/* 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);
|
||||
|
Loading…
Reference in New Issue
Block a user