viff

changeset 1579:f1d477e94d0b tip

runtime: Fix Twisted compatibility for real.
author Marcel Keller <m.keller@bristol.ac.uk>
date Thu, 01 May 2014 18:38:25 +0100
parents f912790a8a36
children
files viff/runtime.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line diff
     1.1 --- a/viff/runtime.py	Thu May 01 16:09:09 2014 +0100
     1.2 +++ b/viff/runtime.py	Thu May 01 18:38:25 2014 +0100
     1.3 @@ -301,7 +301,7 @@
     1.4          """
     1.5          # needed to make VIFF reactor work with later versions of Twisted
     1.6          if 'recvd' not in self.__dict__:
     1.7 -            self.recvd = self._unprocessed[self._compatibilityOffset:]
     1.8 +            self._unprocessed = self._unprocessed[self._compatibilityOffset:]
     1.9          if self.peer_id is None:
    1.10              # TODO: Handle ValueError if the string cannot be decoded.
    1.11              self.peer_id = int(string)
    1.12 @@ -340,6 +340,8 @@
    1.13                      deq.append(data)
    1.14              except struct.error, e:
    1.15                  self.factory.runtime.abort(self, e)
    1.16 +        if 'recvd' not in self.__dict__:
    1.17 +            self.recvd = self._unprocessed
    1.18  
    1.19      def sendData(self, program_counter, data_type, data):
    1.20          """Send data to the peer.