]> granicus.if.org Git - libevent/commit
Make IOCP rate-limiting group support stricter and less surprising.
authorNick Mathewson <nickm@torproject.org>
Wed, 24 Aug 2011 22:41:35 +0000 (18:41 -0400)
committerNick Mathewson <nickm@torproject.org>
Sun, 28 Aug 2011 18:39:11 +0000 (14:39 -0400)
commita98da7bfc9148fd4c51d46320f51a6d28eed3463
treec9c25824121447a1c07e7c3701d85ea9c8f82567
parentc75341b077d14f6f9f76b304295a10dafec2a069
Make IOCP rate-limiting group support stricter and less surprising.

Previously, we wouldn't decrement read/write buckets because of IOCP
reads and writes until those reads and writes were complete.  That's
not so bad on the per-connection front.  But for group limits, the
old approach makes us launch a huge amount of reads and writes
whenever the group limit becomes positive, and then decrement the
limit to a hugely negative number as they complete.

With this patch, we decrement our read buckets whenever we launch an
IOCP read or write, based on the maximum that tried to read or
write.  Later, when the operations finish, we re-increment the
bucket based on the portion of the request that couldn't finish.
bufferevent_async.c