msmith - in flumotion/branches/platform-3: . flumotion/component/misc/porter flumotion/twisted

flumotion-commit at lists.fluendo.com flumotion-commit at lists.fluendo.com
Fri Jun 1 16:20:06 CEST 2007


Author: msmith
Date: Fri Jun  1 16:20:03 2007
New Revision: 5087

Modified:
   flumotion/branches/platform-3/ChangeLog
   flumotion/branches/platform-3/flumotion/component/misc/porter/porterclient.py
   flumotion/branches/platform-3/flumotion/twisted/fdserver.py
Log:
        * flumotion/component/misc/porter/porterclient.py:
        * flumotion/twisted/fdserver.py:
          Backport: get peer address when initially creating an
          FDPassingBroker's child connection; pass to child to use in getPeer.
          Prevent failures in getPeer later.



Modified: flumotion/branches/platform-3/ChangeLog
==============================================================================
--- flumotion/branches/platform-3/ChangeLog	(original)
+++ flumotion/branches/platform-3/ChangeLog	Fri Jun  1 16:20:03 2007
@@ -1,5 +1,13 @@
 2007-06-01  Michael Smith <msmith at fluendo.com>
 
+	* flumotion/component/misc/porter/porterclient.py:
+	* flumotion/twisted/fdserver.py:
+	  Backport: get peer address when initially creating an
+	  FDPassingBroker's child connection; pass to child to use in getPeer.
+	  Prevent failures in getPeer later.
+
+2007-06-01  Michael Smith <msmith at fluendo.com>
+
 	* flumotion/twisted/flavors.py:
 	  Backport: minor fix to not use setattr() where it's not needed;
 	  silences pychecker.

Modified: flumotion/branches/platform-3/flumotion/component/misc/porter/porterclient.py
==============================================================================
--- flumotion/branches/platform-3/flumotion/component/misc/porter/porterclient.py	(original)
+++ flumotion/branches/platform-3/flumotion/component/misc/porter/porterclient.py	Fri Jun  1 16:20:03 2007
@@ -37,8 +37,9 @@
     Similar to tcp.Server, but gets the initial FD from a different source,
     obviously, and also passes along some data with the original connection.
     """
-    def __init__(self, sock, protocol, additionalData):
+    def __init__(self, sock, protocol, addr, additionalData):
         Connection.__init__(self, sock, protocol)
+        self.client = addr
         
         # Inform the protocol we've made a connection.
         protocol.makeConnection(self)
@@ -60,7 +61,7 @@
         return address.IPv4Address('TCP', *(self.socket.getsockname() + ('INET',)))
 
     def getPeer(self):
-        return address.IPv4Address('TCP', *(self.socket.getpeername() + ('INET',)))
+        return address.IPv4Address('TCP', *(self.client + ('INET',)))
 
 class PorterMedium(medium.BaseMedium):
     """

Modified: flumotion/branches/platform-3/flumotion/twisted/fdserver.py
==============================================================================
--- flumotion/branches/platform-3/flumotion/twisted/fdserver.py	(original)
+++ flumotion/branches/platform-3/flumotion/twisted/fdserver.py	Fri Jun  1 16:20:03 2007
@@ -142,11 +142,11 @@
             peeraddr = sock.getpeername()
            
             # Based on bits in tcp.Port.doRead()
-            protocol = self.childFactory.buildProtocol(
-                address._ServerFactoryIPv4Address('TCP', 
-                     peeraddr[0], peeraddr[1]))
+            addr = address._ServerFactoryIPv4Address('TCP', 
+                peeraddr[0], peeraddr[1])
+            protocol = self.childFactory.buildProtocol(addr)
 
-            self._connectionClass(sock, protocol, message)
+            self._connectionClass(sock, protocol, peeraddr, message)
         else:
             self.warning("Unexpected: FD-passing message with len(fds) != 1")
 


More information about the flumotion-commit mailing list