Skip to content

Commit

Permalink
#691: add debug logging to error path for sockets
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@7785 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Sep 24, 2014
1 parent 3ecc7cb commit ad9fa5b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/xpra/net/bytestreams.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
import errno
import socket

from xpra.log import Logger
log = Logger("network", "protocol")

#on some platforms (ie: OpenBSD), reading and writing from sockets
#raises an IOError but we should continue if the error code is EINTR
#this wrapper takes care of it.
Expand All @@ -35,11 +38,14 @@ def untilConcludes(is_active_cb, f, *a, **kw):
while is_active_cb():
try:
return f(*a, **kw)
except socket.timeout:
except socket.timeout as e:
log("untilConcludes(%s, %s, %s, %s) %s", is_active_cb, f, a, kw, e)
continue
except (IOError, OSError) as e:
if e.args[0] in CONTINUE:
log("untilConcludes(%s, %s, %s, %s) %s (continue)", is_active_cb, f, a, kw, e)
continue
log("untilConcludes(%s, %s, %s, %s) %s (raised)", is_active_cb, f, a, kw, e)
raise


Expand Down

0 comments on commit ad9fa5b

Please sign in to comment.