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 wrap: on
line diff
--- a/viff/runtime.py	Thu May 01 16:09:09 2014 +0100
+++ b/viff/runtime.py	Thu May 01 18:38:25 2014 +0100
@@ -301,7 +301,7 @@
         """
         # needed to make VIFF reactor work with later versions of Twisted
         if 'recvd' not in self.__dict__:
-            self.recvd = self._unprocessed[self._compatibilityOffset:]
+            self._unprocessed = self._unprocessed[self._compatibilityOffset:]
         if self.peer_id is None:
             # TODO: Handle ValueError if the string cannot be decoded.
             self.peer_id = int(string)
@@ -340,6 +340,8 @@
                     deq.append(data)
             except struct.error, e:
                 self.factory.runtime.abort(self, e)
+        if 'recvd' not in self.__dict__:
+            self.recvd = self._unprocessed
 
     def sendData(self, program_counter, data_type, data):
         """Send data to the peer.