Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/sugar/p2p/MostlyReliablePipe.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <mpg@redhat.com>2006-05-19 18:19:03 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2006-05-19 18:19:03 (GMT)
commit8499e97a0050e6dbd9ea6f72aa1e7826ab003742 (patch)
treeb7fc6698484e9ef18e1cdeacf8f6fd93f2bb84a0 /sugar/p2p/MostlyReliablePipe.py
parentd2cc475095f371249251cbfc174a409f3349f2e3 (diff)
Merge
Diffstat (limited to 'sugar/p2p/MostlyReliablePipe.py')
-rw-r--r--sugar/p2p/MostlyReliablePipe.py31
1 files changed, 17 insertions, 14 deletions
diff --git a/sugar/p2p/MostlyReliablePipe.py b/sugar/p2p/MostlyReliablePipe.py
index 9e79473..e6ba342 100644
--- a/sugar/p2p/MostlyReliablePipe.py
+++ b/sugar/p2p/MostlyReliablePipe.py
@@ -537,20 +537,23 @@ class MostlyReliablePipe(object):
return False
def _retransmit_check_worker(self):
- now = time.time()
- for key in self._incoming.keys()[:]:
- message = self._incoming[key]
- if message.complete():
- continue
- next_rt = message.next_rt_time()
- if next_rt == 0 or next_rt > now:
- continue
- if self._retransmit_request(message):
- # Kill the message, too many retries
- print "(MRP): Dropped message %s, exceeded retries." % _stringify_sha(message.sha())
- self._dispatched[key] = message
- message.set_dispatch_time()
- del self._incoming[key]
+ try:
+ now = time.time()
+ for key in self._incoming.keys()[:]:
+ message = self._incoming[key]
+ if message.complete():
+ continue
+ next_rt = message.next_rt_time()
+ if next_rt == 0 or next_rt > now:
+ continue
+ if self._retransmit_request(message):
+ # Kill the message, too many retries
+ print "(MRP): Dropped message %s, exceeded retries." % _stringify_sha(message.sha())
+ self._dispatched[key] = message
+ message.set_dispatch_time()
+ del self._incoming[key]
+ except KeyboardInterrupt:
+ return False
return True
def _process_incoming_data(self, segment):