Ignore:
Timestamp:
Mar 7, 2011, 7:40:16 PM (11 years ago)
Author:
Ralph Meijer <ralphm@…>
Branch:
default
Message:

Track change in Twisted Words, to pass a reason Failure with STREAM_END_EVENT.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • wokkel/subprotocols.py

    r96 r98  
    1111
    1212from twisted.internet import defer
    13 from twisted.python import log
     13from twisted.internet.error import ConnectionDone
     14from twisted.python import failure, log
    1415from twisted.words.protocols.jabber import error, xmlstream
    1516from twisted.words.protocols.jabber.xmlstream import toResponse
     
    247248
    248249
    249     def _disconnected(self, _):
     250    def _disconnected(self, reason):
    250251        """
    251252        Called when the stream has been closed.
     
    258259        self._initialized = False
    259260
     261        # Twisted versions before 11.0 passed an XmlStream here.
     262        if not hasattr(reason, 'trap'):
     263            reason = failure.Failure(ConnectionDone())
     264
    260265        # Notify all child services which implement
    261266        # the IService interface
    262267        for e in self:
    263             e.connectionLost(None)
     268            e.connectionLost(reason)
    264269
    265270
Note: See TracChangeset for help on using the changeset viewer.