Commit a98da7bfc9148fd4c51d46320f51a6d28eed3463

Nick Mathewson 2011-08-24T18:41:35

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.