Do not rely on sendfile sending requested count

Close #1155
This commit is contained in:
Randall Leeds 2015-11-29 11:14:04 -08:00
parent 79e14a98dd
commit 1f3bdddfb2

View File

@ -379,7 +379,7 @@ class Response(object):
sockno = self.sock.fileno()
sent = 0
for m in range(0, nbytes, BLKSIZE):
while sent != nbytes:
count = min(nbytes - sent, BLKSIZE)
sent += sendfile(sockno, fileno, offset + sent, count)