fix issue #229, put the rigt order for fdout and fdin.

This commit is contained in:
benoitc 2011-07-06 21:30:45 +02:00
parent 7e9f8b5b02
commit 4c2267b0a1
2 changed files with 4 additions and 3 deletions

View File

@ -18,7 +18,7 @@ except MemoryError:
SUPPORTED_PLATFORMS = (
'darwin',
'freebsd',
'dragonfly'
'dragonfly',
'linux2')
if sys.version_info < (2, 6) or \
@ -35,6 +35,7 @@ def sendfile(fdout, fdin, offset, nbytes):
ctypes.c_int]
_nbytes = ctypes.c_uint64(nbytes)
result = _sendfile(fdin, fdout, offset, _nbytes, None, 0)
if result == -1:
e = ctypes.get_errno()
if e == errno.EAGAIN and _nbytes.value:

View File

@ -270,9 +270,9 @@ class Response(object):
nbytes -= BLKSIZE
else:
sent = 0
sent += sendfile(fileno, sockno, offset+sent, nbytes-sent)
sent += sendfile(sockno, fileno, offset+sent, nbytes-sent)
while sent != nbytes:
sent += sendfile(fileno, sockno, offset+sent, nbytes-sent)
sent += sendfile(sockno, fileno, offset+sent, nbytes-sent)
def write_file(self, respiter):
if sendfile is not None and \