mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix issue #229, put the rigt order for fdout and fdin.
This commit is contained in:
parent
7e9f8b5b02
commit
4c2267b0a1
@ -18,7 +18,7 @@ except MemoryError:
|
|||||||
SUPPORTED_PLATFORMS = (
|
SUPPORTED_PLATFORMS = (
|
||||||
'darwin',
|
'darwin',
|
||||||
'freebsd',
|
'freebsd',
|
||||||
'dragonfly'
|
'dragonfly',
|
||||||
'linux2')
|
'linux2')
|
||||||
|
|
||||||
if sys.version_info < (2, 6) or \
|
if sys.version_info < (2, 6) or \
|
||||||
@ -35,6 +35,7 @@ def sendfile(fdout, fdin, offset, nbytes):
|
|||||||
ctypes.c_int]
|
ctypes.c_int]
|
||||||
_nbytes = ctypes.c_uint64(nbytes)
|
_nbytes = ctypes.c_uint64(nbytes)
|
||||||
result = _sendfile(fdin, fdout, offset, _nbytes, None, 0)
|
result = _sendfile(fdin, fdout, offset, _nbytes, None, 0)
|
||||||
|
|
||||||
if result == -1:
|
if result == -1:
|
||||||
e = ctypes.get_errno()
|
e = ctypes.get_errno()
|
||||||
if e == errno.EAGAIN and _nbytes.value:
|
if e == errno.EAGAIN and _nbytes.value:
|
||||||
|
|||||||
@ -270,9 +270,9 @@ class Response(object):
|
|||||||
nbytes -= BLKSIZE
|
nbytes -= BLKSIZE
|
||||||
else:
|
else:
|
||||||
sent = 0
|
sent = 0
|
||||||
sent += sendfile(fileno, sockno, offset+sent, nbytes-sent)
|
sent += sendfile(sockno, fileno, offset+sent, nbytes-sent)
|
||||||
while sent != nbytes:
|
while sent != nbytes:
|
||||||
sent += sendfile(fileno, sockno, offset+sent, nbytes-sent)
|
sent += sendfile(sockno, fileno, offset+sent, nbytes-sent)
|
||||||
|
|
||||||
def write_file(self, respiter):
|
def write_file(self, respiter):
|
||||||
if sendfile is not None and \
|
if sendfile is not None and \
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user