From 9666001e570275fa08a5766639c437d40bbb0545 Mon Sep 17 00:00:00 2001 From: RaNaN Date: Mon, 20 Dec 2010 20:18:11 +0100 Subject: improved bucket --- module/network/HTTPDownload.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'module/network/HTTPDownload.py') diff --git a/module/network/HTTPDownload.py b/module/network/HTTPDownload.py index d0e2eeb1f..f17e16492 100644 --- a/module/network/HTTPDownload.py +++ b/module/network/HTTPDownload.py @@ -22,6 +22,7 @@ from helper import * from os.path import exists, getsize from os import remove #from shutil import move, copyfileobj +from zlib import decompressobj, MAX_WBITS from cookielib import CookieJar @@ -163,10 +164,10 @@ class HTTPDownload(): decompress = lambda data: data if encoding == "gzip": - gz = zlib.decompressobj(16+zlib.MAX_WBITS) + gz = decompressobj(16+MAX_WBITS) decompress = lambda data: gz.decompress(data) if encoding == "deflate": - df = zlib.decompressobj(-zlib.MAX_WBITS) + df = decompressobj(-MAX_WBITS) decompress = lambda data: df.decompress(data) fname = "%s.chunk%d" % (self.filename, i) @@ -271,7 +272,7 @@ if __name__ == "__main__": import sys from Bucket import Bucket bucket = Bucket() - bucket.setRate(200*1024) + bucket.setRate(3000*1024) bucket = None url = "http://speedtest.netcologne.de/test_100mb.bin" -- cgit v1.2.3