msmith - in flumotion/trunk: . flumotion/twisted

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Thu Mar 8 16:49:43 CET 2007


Author: msmith
Date: Thu Mar  8 16:49:40 2007
New Revision: 4604

Modified:
   flumotion/trunk/ChangeLog
   flumotion/trunk/flumotion/twisted/fdserver.py
Log:
        * flumotion/twisted/fdserver.py:
          Backwards compatibility for FDClient; accept messages without our
          special magic cookie.



Modified: flumotion/trunk/ChangeLog
==============================================================================
--- flumotion/trunk/ChangeLog	(original)
+++ flumotion/trunk/ChangeLog	Thu Mar  8 16:49:40 2007
@@ -1,5 +1,11 @@
 2007-03-08  Michael Smith  <msmith at fluendo.com>
 
+	* flumotion/twisted/fdserver.py:
+	  Backwards compatibility for FDClient; accept messages without our
+	  special magic cookie.
+
+2007-03-08  Michael Smith  <msmith at fluendo.com>
+
 	* flumotion/worker/worker.py:
 	  WorkerBrain now only binds sockets in listen(), not in __init__,
 	  which returns False if it fails.

Modified: flumotion/trunk/flumotion/twisted/fdserver.py
==============================================================================
--- flumotion/trunk/flumotion/twisted/fdserver.py	(original)
+++ flumotion/trunk/flumotion/twisted/fdserver.py	Thu Mar  8 16:49:40 2007
@@ -53,10 +53,6 @@
 
 class FDClient(unix.Client): #, log.Loggable):
 
-    #def connectionLost(self, *args, **kwargs):
-    #    self.debug("connectionLost on FDClient")
-    #    return unix.Client.connectionLost(self, *args, **kwargs)
-
     def doRead(self):
         if not self.connected:
             return
@@ -72,7 +68,6 @@
                 return main.CONNECTION_DONE
 
             if len(fds) > 0:
-     #           self.debug("received one or more FDs")
                 # Look for our magic cookie in (possibly) the midst of other
                 # data. Pass surrounding chunks, if any, onto dataReceived(), 
                 # which (undocumentedly) must return None unless a failure 
@@ -81,7 +76,10 @@
                 # fileDescriptorsReceived()
                 offset = message.find(MAGIC_SIGNATURE)
                 if offset < 0:
-                    raise TypeError("Bad signature")
+                    # Old servers did not send this; be hopeful that this
+                    # doesn't have bits of other protocol (i.e. PB) mixed up 
+                    # in it.
+                    return self.protocol.fileDescriptorsReceived(fds, message)
                 elif offset > 0:
                     ret = self.protocol.dataReceived(message[0:offset])
                     if ret:


More information about the flumotion-commit mailing list