[Commits] (bkirsch) fixes addition in Twisted 2.0 which sets the protocol.factory to the wrappingFactory. This breaks the mail code and in my opinion is not the right behavior. I will take it up on the Twisted mailing list

commits at osafoundation.org commits at osafoundation.org
Fri Apr 15 12:20:18 PDT 2005


Commit by: bkirsch
Modified files:
internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py 1.11 1.12

Log message:
fixes addition in Twisted 2.0 which sets the protocol.factory to the wrappingFactory. This breaks the mail code and in my opinion is not the right behavior. I will take it up on the Twisted mailing list

ViewCVS links:
http://cvs.osafoundation.org/index.cgi/internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py.diff?r1=text&tr1=1.11&r2=text&tr2=1.12

Index: internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py
diff -u internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:1.11 internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:1.12
--- internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:1.11	Tue Feb  1 15:56:50 2005
+++ internal/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py	Fri Apr 15 12:20:16 2005
@@ -5,7 +5,7 @@
 All rights reserved.
 """
 
-RCS_id='$Id: TwistedProtocolWrapper.py,v 1.11 2005/02/01 23:56:50 heikki Exp $'
+RCS_id='$Id: TwistedProtocolWrapper.py,v 1.12 2005/04/15 19:20:16 bkirsch Exp $'
 
 from twisted.protocols.policies import ProtocolWrapper
 from twisted.python.failure import Failure
@@ -46,7 +46,15 @@
     def __init__(self, factory, wrappedProtocol):
         if debug:
             print 'TwistedProtocolWrapper.__init__'
-        ProtocolWrapper.__init__(self, factory, wrappedProtocol)
+
+        #XXX: Twisted 2.0 has a new addition where the wrappingFactory is
+        #     set as the factory of the wrappedProtocol. This is an issue
+        #     as the wrap should be transparent. What we want is 
+        #     the factory of the wrappedProtocol to be the wrappedFactory and
+        #     not the outer wrappingFactory. This is how it was implemented in 
+        #     Twisted 1.3
+        self.factory = factory
+        self.wrappedProtocol = wrappedProtocol
 
         # wrappedProtocol == client/server instance
         # factory.wrappedFactory == client/server factory



More information about the Commits mailing list