diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-04-08 05:43:52 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-04-08 05:43:52 +0000 |
commit | 5d466b76112ab5eaf59d9da4690f230abc9b2f44 (patch) | |
tree | e648d6812fe992df7378086741e09c6fe7abc61b /src/or/dirserv.c | |
parent | 7a804572ab18c4de0e576e521d583a5fa07808ac (diff) | |
download | tor-5d466b76112ab5eaf59d9da4690f230abc9b2f44.tar.gz tor-5d466b76112ab5eaf59d9da4690f230abc9b2f44.zip |
Fix a couple of things that make GCC complain with verbose warnings on. Also, fix some whitespace.
svn:r6317
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 43fa17df15..0166c95b91 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1192,6 +1192,12 @@ static uint32_t stable_uptime = 0; /* start at a safe value */ static uint32_t fast_bandwidth = 0; static uint32_t guard_bandwidth = 0; +static INLINE int +real_uptime(routerinfo_t *router, time_t now) +{ + return router->uptime + (now - router->cache_info.published_on); +} + /** Return 1 if <b>router</b> is not suitable for these parameters, else 0. * If <b>need_uptime</b> is non-zero, we require a minimum uptime. * If <b>need_capacity</b> is non-zero, we require a minimum advertised @@ -1203,7 +1209,7 @@ dirserv_thinks_router_is_unreliable(time_t now, int need_uptime, int need_capacity) { if (need_uptime && - router->uptime+(now - router->cache_info.published_on) < stable_uptime) + (unsigned)real_uptime(router, now) < stable_uptime) return 1; if (need_capacity && router_get_advertised_bandwidth(router) < fast_bandwidth) @@ -1236,7 +1242,7 @@ dirserv_compute_performance_thresholds(routerlist_t *rl) if (ri->is_running && ri->is_valid) { uint32_t *up = tor_malloc(sizeof(uint32_t)); uint32_t *bw = tor_malloc(sizeof(uint32_t)); - *up = (uint32_t) ri->uptime + (now - ri->cache_info.published_on); + *up = (uint32_t) real_uptime(ri, now); smartlist_add(uptimes, up); *bw = router_get_advertised_bandwidth(ri); smartlist_add(bandwidths, bw); |