def _eventlet_sendfile(fdout, fdin, offset, nbytes): while True: try: return o_sendfile(fdout, fdin, offset, nbytes) except OSError as e: if e.args[0] == errno.EAGAIN: trampoline(fdout, write=True) else: raise
def _gevent_sendfile(fdout, fdin, offset, nbytes): while True: try: return o_sendfile(fdout, fdin, offset, nbytes) except OSError as e: if e.args[0] == errno.EAGAIN: wait_write(fdout) else: raise
def _guv_sendfile(fdout, fdin, offset, nbytes): while True: try: return o_sendfile(fdout, fdin, offset, nbytes) except OSError as e: if get_errno(e) == errno.EAGAIN: if not isinstance(fdout, int): fd = fdout.fileno() else: fd = fdout trampoline(fd, WRITE) else: raise