[CalendarServer-changes] [5877] CalendarServer/branches/users/wsanchez/deployment/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Tue Jul 13 11:17:06 PDT 2010


Revision: 5877
          http://trac.macosforge.org/projects/calendarserver/changeset/5877
Author:   glyph at apple.com
Date:     2010-07-13 11:17:02 -0700 (Tue, 13 Jul 2010)
Log Message:
-----------
only call getpeername once

Modified Paths:
--------------
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/metafd.py
    CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/sendfdport.py

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/metafd.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/metafd.py	2010-07-13 16:54:57 UTC (rev 5876)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/metafd.py	2010-07-13 18:17:02 UTC (rev 5877)
@@ -77,13 +77,13 @@
         self.reportingFactory.inheritedPort.stopReading()
 
 
-    def createTransport(self, skt, data, protocol):
+    def createTransport(self, addr, skt, data, protocol):
         """
         Create a TCP transport, from a socket object passed by the parent.
         """
         self._connectionCount += 1
         transport = Server(skt, protocol,
-                           skt.getpeername(), JustEnoughLikeAPort,
+                           addr, JustEnoughLikeAPort,
                            self._connectionCount)
         if data == 'SSL':
             transport.startTLS(self.contextFactory)

Modified: CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/sendfdport.py
===================================================================
--- CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/sendfdport.py	2010-07-13 16:54:57 UTC (rev 5876)
+++ CalendarServer/branches/users/wsanchez/deployment/twistedcaldav/sendfdport.py	2010-07-13 18:17:02 UTC (rev 5877)
@@ -251,14 +251,14 @@
         @param fd: a file descriptor
 
         @type fd: C{int}
-        
-        @param transportFactory: a 3-argument function that takes the socket
-            object produced from the file descriptor, the (non-ancillary) data
-            sent along with the incoming file descriptor, and the protocol
-            built along with it, and returns an L{ITransport} provider.  Note
-            that this should NOT call C{makeConnection} on the protocol that it
-            produces, as this class will do that.
 
+        @param transportFactory: a 4-argument function that takes the peer
+            address, socket object produced from the file descriptor, the
+            (non-ancillary) data sent along with the incoming file descriptor,
+            and the protocol built along with it, and returns an L{ITransport}
+            provider.  Note that this should NOT call C{makeConnection} on the
+            protocol that it produces, as this class will do that.
+
         @param protocolFactory: an L{IProtocolFactory}
         """
         FileDescriptor.__init__(self)
@@ -297,7 +297,7 @@
                 except:
                     peeraddr = ('0.0.0.0', 0)
                 protocol = self.protocolFactory.buildProtocol(peeraddr)
-                transport = self.transportFactory(skt, description, protocol)
+                transport = self.transportFactory(addr, skt, description, protocol)
                 protocol.makeConnection(transport)
             except:
                 log.err()
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100713/c59ef608/attachment-0001.html>


More information about the calendarserver-changes mailing list