Ticket #5448 defect closed fixed
twisted.protocols.htb.Bucket.drip() returns invalid results
| Reported by: | gsk | Owned by: | jesstess |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Keywords: | |
| Cc: | jesstess, thijs, gsk | Branch: |
branches/htb-drip-5448
(diff, github, buildbot, log) |
| Author: | gsk | Launchpad Bug: |
Description
From the api docs ( http://twistedmatrix.com/documents/current/api/twisted.protocols.htb.Bucket.html)
The method drip() of the Bucket class "Returns True if I am now empty."
The current drip() returns True only if the rate is zero (causing the bucket to drain instantaneously). This behavior does not take into account the possibility that a bucket will drain itself over time.
Attached is a patch containing a unit test for this issue and changes to the Bucket class that remedies this issue.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

