]> granicus.if.org Git - libevent/commitdiff
Use a more precise calculation for max in time-ratelim.c
authorNick Mathewson <nickm@torproject.org>
Thu, 18 Sep 2014 16:04:16 +0000 (12:04 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 18 Sep 2014 16:04:16 +0000 (12:04 -0400)
CID 1239297

test/test-ratelim.c

index 28aed2893dd50063f750aad7063cd25d3916de69..17babfdcbcf5804af022805849a2b395f78aa0c8 100644 (file)
@@ -220,7 +220,7 @@ check_bucket_levels_cb(evutil_socket_t fd, short events, void *arg)
 #undef B
 
        total_n_bev_checks++;
-       if (total_n_bev_checks >= .8 * (cfg_duration / cfg_tick_msec) * cfg_n_connections) {
+       if (total_n_bev_checks >= .8 * ((double)cfg_duration / cfg_tick_msec) * cfg_n_connections) {
                event_free(event_base_get_running_event(bufferevent_get_base(bev)));
        }
 }