Skip to content

Commit

Permalink
ziti.accept should raise BlockingIOError(OS error EWOULDBLOCK/EAGAIN)…
Browse files Browse the repository at this point in the history
… is no incoming client

[fixes #51]
  • Loading branch information
ekoby committed Nov 2, 2023
1 parent 6f436f3 commit 771fbb2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/openziti/zitilib.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,13 @@ def check_error(code):
err = _ziti_lasterr()
if err < 0:
msg = _ziti_errorstr(err).decode(encoding='utf-8')
else:
msg = errorstr(err)
raise Exception(err, msg)
raise Exception(err, msg)

if err in [socket.EWOULDBLOCK, socket.EAGAIN]:
raise BlockingIOError()

msg = os.strerror(err)
raise OSError(err, msg)


def init():
Expand Down

0 comments on commit 771fbb2

Please sign in to comment.