viff

changeset 959:0e067bc07ee3

Avoid sending data to ourselves in Bracha broadcast.
author Martin Geisler <mg@daimi.au.dk>
date Thu, 02 Oct 2008 21:39:51 +0200
parents 0c69f21714b7
children c1f4a7b57e75
files viff/active.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line diff
     1.1 --- a/viff/active.py	Thu Oct 02 21:07:31 2008 +0200
     1.2 +++ b/viff/active.py	Thu Oct 02 21:39:51 2008 +0200
     1.3 @@ -113,9 +113,6 @@
     1.4          # In the following we prepare to handle a send message from
     1.5          # the sender and at most one echo and one ready message from
     1.6          # each player.
     1.7 -        d_send = Deferred().addCallback(send_received)
     1.8 -        self._expect_data(sender, "send", d_send)
     1.9 -
    1.10          for peer_id in self.players:
    1.11              if peer_id != self.id:
    1.12                  d_echo = Deferred().addCallback(echo_received, peer_id)
    1.13 @@ -130,6 +127,10 @@
    1.14          if self.id == sender:
    1.15              unsafe_broadcast("send", message)
    1.16              send_received(message)
    1.17 +        else:
    1.18 +            d_send = Deferred().addCallback(send_received)
    1.19 +            self._expect_data(sender, "send", d_send)
    1.20 +
    1.21  
    1.22          return result
    1.23