diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-30 00:00:23 +0100 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-12-30 00:00:23 +0100 |
commit | ad8d7b544ba46f17096eba2828a99ea56a117bc0 (patch) | |
tree | 628dc1f723559185763edc90c5a460306266ad4d /module/network/HTTPChunk.py | |
parent | MU free fixed (diff) | |
download | pyload-ad8d7b544ba46f17096eba2828a99ea56a117bc0.tar.xz |
improved performance for wlan
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r-- | module/network/HTTPChunk.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 5cb1d9178..dee185342 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -175,12 +175,17 @@ class HTTPChunk(HTTPRequest): def writeBody(self, buf): size = len(buf) + self.arrived += size self.fp.write(buf) if self.p.bucket: sleep(self.p.bucket.consumed(size)) + else: #@TODO nice to have: traffic sharping algr. which calculates sleep time to reduce cpu load + if size < 5000: + #sleep if chunk size gets low, to avoid many function calls and hope chunksize gets bigger + sleep(0.007) if self.range and self.arrived > (self.range[1]-self.range[0]): return 0 #close if we have enough data |