From 9c511663f874e6694061c2bd8e38bfdfb0b6ec2f Mon Sep 17 00:00:00 2001 From: Philippe Crama Date: Wed, 22 Dec 2010 20:08:41 +0100 Subject: Bugfixes: when skipping PINGing bitlbee, update PONG timestamp, watch input socket for exceptional situations --- skype/skyped.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/skype/skyped.py b/skype/skyped.py index 61d3b388..9bfc7c6d 100644 --- a/skype/skyped.py +++ b/skype/skyped.py @@ -283,14 +283,17 @@ def serverloop(options, skype): handler_ok = True while (len(in_error) == 0) and handler_ok and options.conn: ready_to_read, ready_to_write, in_error = \ - select.select([options.conn], [], [], timeout) + select.select([options.conn], [], [options.conn], \ + timeout) now = time.time() - handler_ok = True - if len(ready_to_read) == 1: + handler_ok = len(in_error) == 0 + if (len(ready_to_read) == 1) and handler_ok: handler_ok = input_handler(ready_to_read.pop()) # don't ping bitlbee/skype if they already received data + now = time.time() # allow for the input_handler to take some time bitlbee_ping_start_time = now skype_ping_start_time = now + options.last_bitlbee_pong = now if (now - skype_ping_period > skype_ping_start_time) and handler_ok: handler_ok = skype_idle_handler(skype) skype_ping_start_time = now -- cgit v1.2.3