From 44ffc1d8fca5c54f4826012cc931d40f763b2ccf Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Thu, 16 Jul 2009 14:54:17 +0200 Subject: [PATCH] [entropy.services.interfaces] fine tune watch dog --- libraries/entropy/services/interfaces.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/entropy/services/interfaces.py b/libraries/entropy/services/interfaces.py index 449971408..67c817f34 100644 --- a/libraries/entropy/services/interfaces.py +++ b/libraries/entropy/services/interfaces.py @@ -453,7 +453,7 @@ class SocketHost: 'InterruptError: command too long: %s, limit: %s' % ( self.__data_counter, self.max_command_length,)) - buf_empty_watchdog_count = 200 + buf_empty_watchdog_count = 50 # * 0.05 = 2,5 seconds while self.__data_counter > 0: if self.ssl: x = '' @@ -464,7 +464,9 @@ class SocketHost: xlen = len(x) self.__data_counter -= xlen self.buffered_data += x - if xlen == 0 and self.__data_counter: + # if we did not receive a shit and we still + # need some data, trigger the watchdog + if (xlen == 0) and (self.__data_counter > 0): buf_empty_watchdog_count -= 1 time.sleep(0.05) if buf_empty_watchdog_count < 1: