Skip to content
Browse files

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

  • Loading branch information...
1 parent 7e9f8b5 commit 4c2267b0a11e25c2c611e5dd34b716321447c54d @benoitc benoitc committed Jul 6, 2011
Showing with 4 additions and 3 deletions.
  1. +2 −1 gunicorn/http/_sendfile.py
  2. +2 −2 gunicorn/http/wsgi.py
View
3 gunicorn/http/_sendfile.py
@@ -18,7 +18,7 @@
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
4 gunicorn/http/wsgi.py
@@ -270,9 +270,9 @@ def sendfile_all(self, fileno, sockno, offset, nbytes):
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 \

0 comments on commit 4c2267b

Please sign in to comment.
Something went wrong with that request. Please try again.