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