[CalendarServer-changes] [9095] CalendarServer/branches/users/glyph/ipv6-client/calendarserver/push/ applepush.py

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


Revision: 9095
          http://trac.macosforge.org/projects/calendarserver/changeset/9095
Author:   glyph at apple.com
Date:     2012-04-13 11:47:22 -0700 (Fri, 13 Apr 2012)
Log Message:
-----------
connectSSL -> GAIEndpoint in applepush

Modified Paths:
--------------
    CalendarServer/branches/users/glyph/ipv6-client/calendarserver/push/applepush.py

Modified: CalendarServer/branches/users/glyph/ipv6-client/calendarserver/push/applepush.py
===================================================================
--- CalendarServer/branches/users/glyph/ipv6-client/calendarserver/push/applepush.py	2012-04-13 18:47:17 UTC (rev 9094)
+++ CalendarServer/branches/users/glyph/ipv6-client/calendarserver/push/applepush.py	2012-04-13 18:47:22 UTC (rev 9095)
@@ -1,3 +1,4 @@
+# -*- test-case-name: calendarserver.push.test.test_applepush -*-
 ##
 # Copyright (c) 2011-2012 Apple Inc. All rights reserved.
 #
@@ -16,7 +17,7 @@
 
 from twext.internet.ssl import ChainingOpenSSLContextFactory
 from twext.python.log import Logger, LoggingMixIn
-from twext.python.log import LoggingMixIn
+
 from twext.web2 import responsecode
 from txdav.xml import element as davxml
 from twext.web2.dav.noneprops import NonePropertyStore
@@ -25,22 +26,25 @@
 from twext.web2.http_headers import MimeType
 from twext.web2.server import parsePOSTData
 from twisted.application import service
-from twisted.internet import reactor, protocol
+from twisted.internet import protocol
 from twisted.internet.defer import inlineCallbacks, returnValue, succeed
 from twisted.internet.protocol import ClientFactory, ReconnectingClientFactory
-from twistedcaldav.extensions import DAVResource, DAVResourceWithoutChildrenMixin
+from twistedcaldav.extensions import DAVResourceWithoutChildrenMixin
 from twistedcaldav.resource import ReadOnlyNoCopyResourceMixIn
 import OpenSSL
 import struct
 import time
 from txdav.common.icommondatastore import InvalidSubscriptionValues
+
 from calendarserver.push.util import validToken, TokenHistory, PushScheduler
 
+from twext.internet.adaptendpoint import connect
+from twext.internet.gaiendpoint import GAIEndpoint
 
-
 log = Logger()
 
 
+
 class ApplePushNotifierService(service.MultiService, LoggingMixIn):
     """
     ApplePushNotifierService is a MultiService responsible for
@@ -394,9 +398,11 @@
                 passwdCallback=passwdCallback,
                 sslmethod=getattr(OpenSSL.SSL, self.sslMethod)
             )
-            reactor.connectSSL(self.host, self.port, factory, context)
+            connect(GAIEndpoint(self.reactor, self.host, self.port, context),
+                    factory)
 
 
+
 class APNProviderService(APNConnectionService):
 
     def __init__(self, store, host, port, certPath, keyPath, chainPath="",
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120413/d2c21846/attachment-0001.html>


More information about the calendarserver-changes mailing list