diff options
Diffstat (limited to 'module/network/HTTPChunk.py')
-rw-r--r-- | module/network/HTTPChunk.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/module/network/HTTPChunk.py b/module/network/HTTPChunk.py index 6ffc43078..6f9454c56 100644 --- a/module/network/HTTPChunk.py +++ b/module/network/HTTPChunk.py @@ -78,9 +78,7 @@ class HTTPChunk(HTTPBase): break count = self.bufferSize if self.noRangeHeader: - if self.range[1] <= self.arrived+count: - count = min(count, self.arrived+count - self.range[1]) - running = False + count = min(count, self.range[1]-self.range[0] - self.arrived+count) if self.bucket: count = self.bucket.add(count) if count == 0: @@ -100,12 +98,10 @@ class HTTPChunk(HTTPBase): self.speedCalcTime = inttime() self.speedCalcLen = 0 size = len(data) + if self.arrived+size == self.range[1]-self.range[0]: + running = False self.speedCalcLen += size self.arrived += size - if self.noRangeHeader: - if self.range[1] <= self.arrived: - self.fh.write(data[:-(self.arrived-self.range[1])]) - break if data: self.fh.write(data) |