diff options
author | mkaay <mkaay@mkaay.de> | 2010-12-25 00:24:24 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-12-25 00:24:24 +0100 |
commit | 9b9b7d4fd75f88492ab407cc2ccbdc7df3054323 (patch) | |
tree | 538472b1970d75ddd97a5b9a4b76faa2ba91bc58 /module/network/HTTPChunk.py | |
parent | fixed reusing bad connection (diff) | |
download | pyload-9b9b7d4fd75f88492ab407cc2ccbdc7df3054323.tar.xz |
fixed weird issues, comments
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r-- | module/network/HTTPChunk.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 48ebc13f3..02134ca63 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -85,7 +85,7 @@ class HTTPChunk(HTTPBase): try: data = resp.read(count) except: - self.deferred.error("timeout") + self.deferred.error(Fail, "timeout") break if self.speedCalcTime < inttime(): @@ -104,7 +104,7 @@ class HTTPChunk(HTTPBase): if self.noRangeHeader and self.arrived == self.range[1]: running = False - if data: + if size: self.fh.write(data) else: break @@ -117,9 +117,10 @@ class HTTPChunk(HTTPBase): if self.abort: self.deferred.error(Abort) elif self.size == self.arrived: - self.deferred.callback(resp) + self.deferred.callback() else: - self.deferred.error(Fail) + print self.arrived, self.size + self.deferred.error(Fail, "wrong content-length") def getEncoding(self): try: @@ -140,7 +141,7 @@ class HTTPChunk(HTTPBase): self.deferred.error(e) return self.deferred - if (self.range and resp.getcode() == 206) or (not self.range and resp.getcode() == 200): + if resp.getcode() in (200, 206): self._download(resp) else: self.deferred.error(resp.getcode(), resp) |