]> granicus.if.org Git - libevent/commit
Fix serious bugs in per-bufferevent rate-limiting code
authorNick Mathewson <nickm@torproject.org>
Tue, 12 Oct 2010 17:46:14 +0000 (13:46 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 12 Oct 2010 17:54:07 +0000 (13:54 -0400)
commit34d64f8a347147aa5a6ac222f302e12b142a8f2e
treec28a2a1e7f2f0801773c16ced12bb96300604dcf
parent819b1715723f1ab8bdf6f3d21d6eac859cf8950e
Fix serious bugs in per-bufferevent rate-limiting code

Our old code was too zealous about deleting the refill events that
would actually make connections able to read or write again after
they had run out of bandwidth.  Under some circumstances, this could
cause a bufferevent to never actually refill one of its
rate-limiting buckets.

Also, the code treated setting a per-connection rate-limit on a
connection that already had a group-limit as if it were changing the
limit on a connection whose allocation had already run out.

This patch fixes both of those problems.
bufferevent_ratelim.c