From ad9fa5bec329d3e5868629380ef33934caf38137 Mon Sep 17 00:00:00 2001 From: Antoine Martin Date: Wed, 24 Sep 2014 08:30:51 +0000 Subject: [PATCH] #691: add debug logging to error path for sockets git-svn-id: https://xpra.org/svn/Xpra/trunk@7785 3bb7dfac-3a0b-4e04-842a-767bc560f471 --- src/xpra/net/bytestreams.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/xpra/net/bytestreams.py b/src/xpra/net/bytestreams.py index d39e16284e..cb13182c60 100644 --- a/src/xpra/net/bytestreams.py +++ b/src/xpra/net/bytestreams.py @@ -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. @@ -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