From 75777c1089ce1fd2d25865442707f1facf53e8c5 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sun, 19 Dec 2010 21:09:08 +0100 Subject: bucket improvement --- module/network/HTTPChunk.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'module/network/HTTPChunk.py') diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index c7d981880..0c87283f1 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -19,7 +19,6 @@ from HTTPBase import HTTPBase from urllib2 import HTTPError -from threading import Lock from helper import * from time import sleep from traceback import print_exc @@ -76,8 +75,8 @@ class HTTPChunk(HTTPBase): if self.noRangeHeader: count = min(count, self.range[1] - self.arrived) if self.bucket: - allow = self.bucket.consume(count) - if not allow: + count = self.bucket.add(count) + if not count: sleep(0.01) continue -- cgit v1.2.3