Prevent negative DownloadChunk in asyncore
This commit is contained in:
parent
f785558ca5
commit
7ec3fc7a5a
|
@ -79,6 +79,8 @@ class AdvancedDispatcher(asyncore.dispatcher):
|
|||
try:
|
||||
if self.expectBytes > 0 and not self.fullyEstablished:
|
||||
self.downloadChunk = min(self.downloadChunk, self.expectBytes - len(self.read_buf))
|
||||
if self.downloadChunk < 0:
|
||||
self.downloadChunk = 0
|
||||
except AttributeError:
|
||||
pass
|
||||
return asyncore.dispatcher.readable(self) and \
|
||||
|
|
Loading…
Reference in New Issue
Block a user