From 5a4f22e15ec95696b02d9592fdd1b24adae9674e Mon Sep 17 00:00:00 2001 From: Mike Kazantsev Date: Mon, 11 Feb 2013 13:56:04 +0100 Subject: 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. --- protocols/skype/skyped.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'protocols/skype/skyped.py') 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 -- cgit v1.2.3