aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilippe Crama <pcfeb0009@gmx.com>2010-12-22 20:08:41 +0100
committerPhilippe Crama <pcfeb0009@gmx.com>2010-12-22 20:08:41 +0100
commit9c511663f874e6694061c2bd8e38bfdfb0b6ec2f (patch)
tree57effa2b266c35a32263dd198e0e62dc82b92767
parente530abd12978a2c7e4b653a983e8088e6f125832 (diff)
Bugfixes: when skipping PINGing bitlbee, update PONG timestamp, watch input socket for exceptional situations
-rw-r--r--skype/skyped.py9
1 files 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