aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Kazantsev <mk.fraggod@gmail.com>2013-02-11 13:56:04 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-02-11 13:56:04 +0100
commit5a4f22e15ec95696b02d9592fdd1b24adae9674e (patch)
treeb26a2415cc2472c5c3e0ffd8418344daff002613
parent8e166ae8264a7c9f98e766c8635faa94cd075eb8 (diff)
skype: don't do retries on send() on socket errors with gobject
As it's a blocking socket, I imagine there might be only EINTR errors from signals, which don't seem to be used here. I think the same tweak can be applied to select() code, but I don't run it, so no idea if Skype4Py threads might make such loop necessary there.
-rw-r--r--protocols/skype/skyped.py15
1 files changed, 6 insertions, 9 deletions
diff --git a/protocols/skype/skyped.py b/protocols/skype/skyped.py
index 57b2f9ce..68008fbf 100644
--- a/protocols/skype/skyped.py
+++ b/protocols/skype/skyped.py
@@ -126,16 +126,13 @@ def skype_idle_handler(skype):
def send(sock, txt, tries=10):
global options
if hasgobject:
- for attempt in xrange(1, tries+1):
- try:
- sock.sendall(txt)
- except Exception, s:
- dprint("Warning, sending '%s' failed (%s). count=%d" % (txt, s, attempt))
- time.sleep(1)
- else:
- break
- else:
+ if not options.conn: return
+ try:
+ sock.sendall(txt)
+ except Exception, s:
+ dprint("Warning, sending '%s' failed (%s)." % (txt, s))
options.conn.close()
+ options.conn = False
else:
for attempt in xrange(1, tries+1):
if not options.conn: break