[CalendarServer-changes] [9093] CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/ scheduling/ischedule.py

source_changes at macosforge.org source_changes at macosforge.org
Fri Apr 13 11:47:13 PDT 2012


Revision: 9093
          http://trac.macosforge.org/projects/calendarserver/changeset/9093
Author:   glyph at apple.com
Date:     2012-04-13 11:47:13 -0700 (Fri, 13 Apr 2012)
Log Message:
-----------
No legacy factory here!  Just replace ClientCreator with GAIEndpoint in twistedcaldav.scheduling.ischedule.

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py

Modified: CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py
===================================================================
--- CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py	2012-04-13 18:47:08 UTC (rev 9092)
+++ CalendarServer/branches/users/glyph/ipv6-client/twistedcaldav/scheduling/ischedule.py	2012-04-13 18:47:13 UTC (rev 9093)
@@ -17,7 +17,7 @@
 from StringIO import StringIO
 
 from twisted.internet.defer import inlineCallbacks, DeferredList, succeed
-from twisted.internet.protocol import ClientCreator
+from twisted.internet.protocol import Factory
 
 from twisted.python.failure import Failure
 
@@ -44,6 +44,7 @@
 from twistedcaldav.util import utf8String, normalizationLookup
 from twistedcaldav.scheduling.cuaddress import PartitionedCalendarUser, RemoteCalendarUser,\
     OtherServerCalendarUser
+from twext.internet.gaiendpoint import GAIEndpoint
 
 """
 Handles the sending of iSchedule scheduling messages. Used for both cross-domain scheduling,
@@ -173,11 +174,14 @@
         # Generate an HTTP client request
         try:
             from twisted.internet import reactor
+            f = Factory()
+            f.protocol = HTTPClientProtocol
             if self.server.ssl:
-                context = _configuredClientContextFactory()
-                proto = (yield ClientCreator(reactor, HTTPClientProtocol).connectSSL(self.server.host, self.server.port, context))
+                ep = GAIEndpoint(reactor, self.server.host, self.server.port,
+                                 _configuredClientContextFactory())
             else:
-                proto = (yield ClientCreator(reactor, HTTPClientProtocol).connectTCP(self.server.host, self.server.port))
+                ep = GAIEndpoint(reactor, self.server.host, self.server.port)
+            proto = (yield ep.connect(f))
             
             request = ClientRequest("POST", self.server.path, self.headers, self.data)
             yield self.logRequest("debug", "Sending server-to-server POST request:", request)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120413/0813fc9c/attachment.html>


More information about the calendarserver-changes mailing list