16 Commits

Author SHA1 Message Date
Nick Mathewson
1115366e95 Fix a few memory leaks in the tests 2010-09-07 10:36:19 -04:00
Nick Mathewson
0bffe43a15 Fix a nasty dangling-event bug when using rate-limiting groups
When we freed a bufferevent that was in a rate-limiting group and
blocked on IO, the process of freeing it caused it to get removed
from the group.  But removing the bufferevent from the group made
its limits get removed, which could make it get un-suspended and in
turn cause its events to get re-added.  Since we would then
immediately _free_ the events, this would result in dangling
pointers.

Fixes bug 3041007.
2010-08-09 12:08:40 -04:00
Nick Mathewson
b2c6202d65 Fix an assertion bug in test-ratelim
If the rate limit was low enough, then the echo_conns wouldn't finish
inside the 300 msec we allowed for them to close.  Instead, count the
number of connections we have, and keep waiting until they are all
closed.
2010-08-04 15:52:32 -04:00
Nick Mathewson
42f6b62414 Add option to test-ratelim to test min_share 2010-08-04 15:51:14 -04:00
Nick Mathewson
75701e897b Add some missing includes to fix Linux build again 2010-05-14 14:30:09 -04:00
Nick Mathewson
b5bfc44d6b Make test-ratelim clean up after itself better. 2010-05-13 15:40:43 -04:00
Nick Mathewson
2b44dccaaf Add options to test-ratelim.c to check its results
The new options let you specify a maximum deviation of bandwidth used
from expected bandwidth used, and make test-ratelim.c exit with a
nonzero status when those deviations are violated.

This patch also adds a test-ratelim.sh script to run test-ratelim with
a few sensible options for testing.
2010-05-13 15:40:43 -04:00
Nick Mathewson
17efc1cdfa Update all our copyright notices to say "2010" 2010-03-04 01:38:48 -05:00
Nick Mathewson
e5bbd40ad7 Clean up formatting: use tabs, not 8-spaces, to indent. 2010-02-18 17:44:09 -05:00
Nick Mathewson
b72be50d7a Add some headers to fix freebsd compilation 2010-02-18 13:52:04 -05:00
Nick Mathewson
918e9c5e72 Fix a number of warnings from gcc -pedantic 2010-01-23 16:38:36 -05:00
Nick Mathewson
e2ca403fae Make it compile under gcc --std=c89. 2010-01-23 16:23:45 -05:00
Nick Mathewson
97a8c79006 Fix compilation of rate-limit code when threading support is disabled 2010-01-22 00:34:21 -05:00
Nick Mathewson
165d30e31a Fix compilation of rate-limiting code on win32. 2009-12-30 14:29:56 -05:00
Nick Mathewson
885b42734c Fix test-ratelim compilation on Linux.
I'd forgotten to include time.h, and to link against libm.
2009-12-30 13:50:52 -05:00
Nick Mathewson
f0c0124e60 Testing code for bufferevent rate-limiting.
This is not part of the regression tests, since running it necessarily
takes a while.  There is a new test-ratelim test; run it with '-h'
for an argument to see its options.
2009-12-28 16:58:22 -05:00