]> granicus.if.org Git - libevent/commit
Fix handling of group rate limits under 64 bytes of burst
authorNick Mathewson <nickm@torproject.org>
Thu, 11 Aug 2011 19:15:17 +0000 (15:15 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 11 Aug 2011 19:15:17 +0000 (15:15 -0400)
commit6d5440e80e7ecd95c52b3f3d5217e1693294404e
tree2320d8188e8bb116d337f65955cc1e1a0a114fc9
parent5d1b255b1475602707d61337107e2ab6e5a94da9
Fix handling of group rate limits under 64 bytes of burst

The "min_share" logic, which was designed to prevent piles of
extremely small writes when running up against a group rate limit,
could lead to confusing behavior if you ever set a min_share less
than your burst rate.  If that happened, then as soon as your group
rate limit was exhausted, you'd stop reading/writing, and never
start again, since the amount readable/writeable would never
actually hit min_share.

We now cap min_share at the rate per tick.

Found by George Kadianakis
bufferevent-internal.h
bufferevent_ratelim.c