+
    üÐj�  ã                   óÔ  € R t ^ RIHt ^ RIHt ^ RIHt ^ RIHtH	t	 ^ RI
HtHt ^ RIHtHt ^ RIHt ^ RIHtHtHt ^ R	IHtHtHt ^ R
IHtHt ^ RIHtHtH t H!t!  ^ RIH"t# ]#PH                  '       g   Rt"M]#t" ]! R4      t&]! R4      t'Rt(Rt)]*! 4       t+R t, ! R R4      t- ! R R]-4      t. ! R R]-4      t/ ! R R]04      t1]! ]Pd                  4       ! R R4      4       t3 ! R R]04      t4 ! R R ]44      t5 ! R! R"]44      t6 ! R# R$]44      t7 ! R% R&]34      t8 ! R' R(]Pr                  4      t9 ! R) R*]Pt                  4      t: ! R+ R,]Pv                  ]Px                  4      t= ! R- R.]04      t>R/ t? ! R0 R1]P€                  4      tAR9R2 ltB]! ]P†                  4       ! R3 R44      4       tD]! ]PŠ                  4       ! R5 R64      4       tF ! R7 R8]F4      tG. R:OtHR#   ]% d    Rt" ELli ; i);a2  
XMPP XML Streams

Building blocks for setting up XML Streams, including helping classes for
doing authentication on either client or server side, and working with XML
Stanzas.

@var STREAM_AUTHD_EVENT: Token dispatched by L{Authenticator} when the
    stream has been completely initialized
@type STREAM_AUTHD_EVENT: L{str}.

@var INIT_FAILED_EVENT: Token dispatched by L{Authenticator} when the
    stream has failed to be initialized
@type INIT_FAILED_EVENT: L{str}.

@var Reset: Token to signal that the XML stream has been reset.
@type Reset: Basic object.
)Úhexlify)Úsha1)Úintern)ÚOptionalÚTuple)ÚdirectlyProvidesÚimplementer)ÚdeferÚprotocol)ÚConnectionLost)ÚfailureÚlogÚ	randbytes)ÚerrorÚijabberÚjid)ÚdomishÚ	xmlstream)ÚSTREAM_CONNECTED_EVENTÚSTREAM_END_EVENTÚSTREAM_ERROR_EVENTÚSTREAM_START_EVENT)ÚsslNz//event/stream/authdz//event/xmpp/initfailedz http://etherx.jabber.org/streamszurn:ietf:params:xml:ns:xmpp-tlsc                óâ   € \        V \        4      '       g   \        R4      h\        V\        4      '       g   \        R4      hV  V 2p\        VP	                  R4      4      P                  4       # )zÎ
Create a SHA1-digest string of a session identifier and password.

@param sid: The stream session identifier.
@type sid: C{unicode}.
@param password: The password to be hashed.
@type password: C{unicode}.
z/The session identifier must be a unicode objectz%The password must be a unicode objectzutf-8)Ú
isinstanceÚstrÚ	TypeErrorr   ÚencodeÚ	hexdigest)ÚsidÚpasswordÚinputs   && ÚJ/usr/lib/python3/dist-packages/twisted/words/protocols/jabber/xmlstream.pyÚhashPasswordr#   @   sa   € ô �cœ3×ÒÜÐIÓJÐJÜ�h¤×$Ò$ÜÐ?Ó@Ð@Øˆe�H�:Ð€EÜ�—‘˜WÓ%Ó&×0Ñ0Ó2Ð2ó    c                   ó<   a € ] tR t^Qt o RtR tR tR tR tRt	V t
R# )ÚAuthenticatora  
Base class for business logic of initializing an XmlStream

Subclass this object to enable an XmlStream to initialize and authenticate
to different types of stream hosts (such as clients, components, etc.).

Rules:
  1. The Authenticator MUST dispatch a L{STREAM_AUTHD_EVENT} when the
     stream has been completely initialized.
  2. The Authenticator SHOULD reset all state information when
     L{associateWithStream} is called.
  3. The Authenticator SHOULD override L{streamStarted}, and start
     initialization there.

@type xmlstream: L{XmlStream}
@ivar xmlstream: The XmlStream that needs authentication

@note: the term authenticator is historical. Authenticators perform
       all steps required to prepare the stream for the exchange
       of XML stanzas.
c                ó   € R V n         R # ©N©r   ©Úselfs   &r"   Ú__init__ÚAuthenticator.__init__h   s	   € ØˆŽr$   c                ó   € R# )a<  
Called by the XmlStream when the underlying socket connection is
in place.

This allows the Authenticator to send an initial root element, if it's
connecting, or wait for an inbound root from the peer if it's accepting
the connection.

Subclasses can use self.xmlstream.send() to send any initial data to
the peer.
N© r*   s   &r"   ÚconnectionMadeÚAuthenticator.connectionMadek   ó   ‚ r$   c                óD  € VP                  R4      '       d?   VR,          P                  R4      p \        V^ ,          4      \        V^,          4      3pMRp\        V P                  P                  V4      V P                  n        R#   \        \        3 d    Rp LFi ; i)aB  
Called by the XmlStream when the stream has started.

A stream is considered to have started when the start tag of the root
element has been received.

This examines C{rootElement} to see if there is a version attribute.
If absent, C{0.0} is assumed per RFC 3920. Subsequently, the
minimum of the version from the received stream header and the
value stored in L{xmlstream} is taken and put back in L{xmlstream}.

Extensions of this method can extract more information from the
stream header and perform checks on them, optionally sending
stream errors and closing the stream.
ÚversionÚ.N)é    r6   )ÚhasAttributeÚsplitÚintÚ
IndexErrorÚ
ValueErrorÚminr   r4   )r+   ÚrootElementr4   s   && r"   ÚstreamStartedÚAuthenticator.streamStartedx   sˆ   € ð  ×#Ñ# I×.Ò.Ø! )Õ,×2Ñ2°3Ó7ˆGð!Ü˜w q�z›?¬C°¸µ
«OÐ<‘ð ˆGä!$ T§^¡^×%;Ñ%;¸WÓ!Eˆ�‰Öøô ¤
Ð+ô !Ø ’ð!ús   ±$B	 Â	BÂBc                ó   € Wn         R# )aQ  
Called by the XmlStreamFactory when a connection has been made
to the requested peer, and an XmlStream object has been
instantiated.

The default implementation just saves a handle to the new
XmlStream.

@type xmlstream: L{XmlStream}
@param xmlstream: The XmlStream that will be passing events to this
                  Authenticator.

Nr)   ©r+   r   s   &&r"   ÚassociateWithStreamÚ!Authenticator.associateWithStream“   s	   € ð #Žr$   r)   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r,   r0   r>   rB   Ú__static_attributes__Ú__classdictcell__©Ú__classdict__s   @r"   r&   r&   Q   s$   ø‡ € ñò,òòF÷6#ð #r$   r&   c                   óL   a € ] tR t^¤t o RtRtR tR tR tR t	V 3R lt
RtV tR# )	ÚConnectAuthenticatorz(
Authenticator for initiating entities.
Nc                ó   € Wn         R # r(   ©Ú	otherHost)r+   rQ   s   &&r"   r,   ÚConnectAuthenticator.__init__«   s   € Ø"Žr$   c                óÎ   € V P                   V P                  n         \        P                  ! V P                  4      V P                  n        V P                  P                  4        R # r(   )Ú	namespacer   r   Ú	internJIDrQ   ÚotherEntityÚ
sendHeaderr*   s   &r"   r0   Ú#ConnectAuthenticator.connectionMade®   s;   € Ø#'§>¡>ˆ�‰Ô Ü%(§]¢]°4·>±>Ó%Bˆ�‰Ô"Ø�‰×!Ñ!Ö#r$   c                óÊ   a aa€ V 3R loVVV 3R lo\         P                  ! R4      pVP                  S4       VP                  S P                  P
                  \        4       R# )aK  
Perform stream initialization procedures.

An L{XmlStream} holds a list of initializer objects in its
C{initializers} attribute. This method calls these initializers in
order and dispatches the L{STREAM_AUTHD_EVENT} event when the list has
been successfully processed. Otherwise it dispatches the
C{INIT_FAILED_EVENT} event with the failure.

Initializers may return the special L{Reset} object to halt the
initialization processing. It signals that the current initializer was
successfully processed, but that the XML Stream has been reset. An
example is the TLSInitiatingInitializer.
c                 óR   <€ SP                   P                  P                  ^ 4       V # )r6   )r   ÚinitializersÚpop)Úresultr+   s   &€r"   Úremove_firstÚ;ConnectAuthenticator.initializeStream.<locals>.remove_firstÃ   s    ø€ Ø�N‰N×'Ñ'×+Ñ+¨AÔ.àˆMr$   c                óX  <€ V \         J d   R#  SP                  P                  ^ ,          p\        P                  ! VP
                  4      pVP                  S4       VP                  S4       V#   \         d/    SP                  P                  SP                  \        4        R# i ; i)z‹
Take the first initializer and process it.

On success, the initializer is removed from the list and
then next initializer will be tried.
N)
ÚResetr   r[   r	   ÚmaybeDeferredÚ
initializeÚaddCallbackr:   ÚdispatchÚSTREAM_AUTHD_EVENT)r]   ÚinitÚdÚdo_nextr^   r+   s   &  €€€r"   ri   Ú6ConnectAuthenticator.initializeStream.<locals>.do_nextÈ   sˆ   ø€ ð œ‹Ùð	Ø—~‘~×2Ñ2°1Õ5�ô
 ×'Ò'¨¯©Ó8�Ø—‘˜lÔ+Ø—‘˜gÔ&Ø�øô ô Ø—‘×'Ñ'¨¯©Ô8JÔKÚðús   �A0 Á05B)Â(B)N)r	   Úsucceedrd   Ú
addErrbackr   re   ÚINIT_FAILED_EVENT)r+   rh   ri   r^   s   f @@r"   ÚinitializeStreamÚ%ConnectAuthenticator.initializeStream³   sB   ú€ õ 	÷
	ô, �MŠM˜$ÓˆØ	�‰�gÔØ	�‰�T—^‘^×,Ñ,Ô.?Ö@r$   c                ó®  a € \         P                  S V4       VP                  R4      S P                  n        VP                  R4      '       d-   \        P                  ! VR,          4      S P                  n        S P                  P                  R8¼  d0   V 3R lpS P                  P                  R\        ,          V4       R# S P                  4        R# )zð
Called by the XmlStream when the stream has started.

This extends L{Authenticator.streamStarted} to extract further stream
headers from C{rootElement}, optionally wait for stream features being
received and then call C{initializeStream}.
ÚidÚfromc                 ó°   <€ / pV P                  4        F  pW!VP                  VP                  3&   K  	  VSP                  n        SP                  4        R # r(   )ÚelementsÚuriÚnamer   Úfeaturesrn   )Úelementrw   Úfeaturer+   s   &  €r"   Ú
onFeaturesÚ6ConnectAuthenticator.streamStarted.<locals>.onFeaturesõ   sJ   ø€ Ø�Ø&×/Ñ/Ö1�GØ<C˜gŸk™k¨7¯<©<Ð8Ó9ñ  2ð +3�—‘Ô'Ø×%Ñ%Ö'r$   z/features[@xmlns="%s"]N©é   r6   )r&   r>   ÚgetAttributer   r   r7   r   rU   rV   r4   ÚaddOnetimeObserverÚ
NS_STREAMSrn   )r+   r=   rz   s   f& r"   r>   Ú"ConnectAuthenticator.streamStartedâ   sœ   ø€ ô 	×#Ñ# D¨+Ô6à(×5Ñ5°dÓ;ˆ�‰Ôà×#Ñ# F×+Ò+Ü),¯ª°{À6Õ7JÓ)KˆD�N‰NÔ&ð �>‰>×!Ñ! VÔ+õ(ð �N‰N×-Ñ-Ø(¬:Õ5°zöð ×!Ñ!Ö#r$   c                ó6   <€ V ^8„  d   Qh/ S[ S[,          ;R&   # ©é   rT   ©r   r   )ÚformatrL   s   "€r"   Ú__annotate__Ú!ConnectAuthenticator.__annotate__¤   ó   ø‡ ‚ ñ
 ™�}Ñ#ò r$   rP   )rD   rE   rF   rG   rH   rT   r,   r0   rn   r>   Ú__annotate_func__rI   rJ   rK   s   @r"   rN   rN   ¤   s/   ø‡ € ñð  $€Iò#ò$ò
-Aò^$÷} ƒ r$   rN   c                   ó@   a € ] tR tRt o RtRtR tR tV 3R ltRt	V t
R# )ÚListenAuthenticatori  z'
Authenticator for receiving entities.
Nc                óR   € \         P                  W4       RV P                  n        R# )zœ
Called by the XmlStreamFactory when a connection has been made.

Extend L{Authenticator.associateWithStream} to set the L{XmlStream}
to be non-initiating.
FN)r&   rB   r   Ú
initiatingrA   s   &&r"   rB   Ú'ListenAuthenticator.associateWithStream  s   € ô 	×)Ñ)¨$Ô:Ø$)ˆ�‰Ö!r$   c                óþ  € \         P                  W4       VP                  V P                  n        VP                  R4      '       d-   \        P                  ! VR,          4      V P                  n        / V P                  n	        VP                  P                  4        F  w  r#W P                  P                  V&   K  	  \        \        P                  ! ^4      4      P                  R4      V P                  n        R# )z¯
Called by the XmlStream when the stream has started.

This extends L{Authenticator.streamStarted} to extract further
information from the stream headers from C{rootElement}.
ÚtoÚasciiN)r&   r>   Ú
defaultUrir   rT   r7   r   rU   Ú
thisEntityÚprefixesÚlocalPrefixesÚitemsr   r   ÚsecureRandomÚdecoder   )r+   r=   Úprefixru   s   &&  r"   r>   Ú!ListenAuthenticator.streamStarted  s±   € ô 	×#Ñ# DÔ6à#.×#9Ñ#9ˆ�‰Ô à×#Ñ# D×)Ò)Ü(+¯ª°kÀ$Õ6GÓ(HˆD�N‰NÔ%à"$ˆ�‰ÔØ&×4Ñ4×:Ñ:Ö<‰KˆFØ+1�N‰N×#Ñ# CÓ(ñ =ô %¤Y×%;Ò%;¸AÓ%>Ó?×FÑFÀwÓOˆ�‰Ör$   c                ó6   <€ V ^8„  d   Qh/ S[ S[,          ;R&   # rƒ   r…   )r†   rL   s   "€r"   r‡   Ú ListenAuthenticator.__annotate__  r‰   r$   r/   )rD   rE   rF   rG   rH   rT   rB   r>   rŠ   rI   rJ   rK   s   @r"   rŒ   rŒ     s#   ø‡ € ñð  $€Iò*òP÷# ƒ r$   rŒ   c                   ó   € ] tR tRtRtRtR# )ÚFeatureNotAdvertizedi*  zd
Exception indicating a stream feature was not advertized, while required by
the initiating entity.
r/   N©rD   rE   rF   rG   rH   rI   r/   r$   r"   rŸ   rŸ   *  ó   † õr$   rŸ   c                   óJ   a € ] tR tRt o RtRtR	R ltR tR tV 3R lt	Rt
V tR# )
Ú BaseFeatureInitiatingInitializeri1  a‹  
Base class for initializers with a stream feature.

This assumes the associated XmlStream represents the initiating entity
of the connection.

@cvar feature: tuple of (uri, name) of the stream feature root element.
@type feature: tuple of (C{str}, C{str})

@ivar required: whether the stream feature is required to be advertized
                by the receiving entity.
@type required: C{bool}
Nc                ó   € Wn         W n        R # r(   )r   Úrequired)r+   Úxsr¥   s   &&&r"   r,   Ú)BaseFeatureInitiatingInitializer.__init__C  s   € ØŒØ Žr$   c                ó    € V P                   V P                  P                  9   d   V P                  4       # V P                  '       d   \
        hR# )a'  
Initiate the initialization.

Checks if the receiving entity advertizes the stream feature. If it
does, the initialization is started. If it is not advertized, and the
C{required} instance variable is C{True}, it raises
L{FeatureNotAdvertized}. Otherwise, the initialization silently
succeeds.
N)ry   r   rw   Ústartr¥   rŸ   r*   s   &r"   rc   Ú+BaseFeatureInitiatingInitializer.initializeG  s8   € ð �<‰<˜4Ÿ>™>×2Ñ2Ô2Ø—:‘:“<ÐØ�]�]ˆ]Ü&Ð&ár$   c                ó   € R# )zZ
Start the actual initialization.

May return a deferred for asynchronous initialization.
Nr/   r*   s   &r"   r©   Ú&BaseFeatureInitiatingInitializer.startY  r2   r$   c                óL   <€ V ^8„  d   Qh/ S[ S[S[S[3,          ,          ;R&   # )r„   ry   )r   r   r   )r†   rL   s   "€r"   r‡   Ú-BaseFeatureInitiatingInitializer.__annotate__1  s   ø‡ ‚ ñ  ‘e™C¡˜H•oÕ&Ñ-ò! r$   )r¥   r   )F)rD   rE   rF   rG   rH   ry   r,   rc   r©   rŠ   rI   rJ   rK   s   @r"   r£   r£   1  s(   ø‡ € ñð *.€Gô!òò$÷Q ƒ r$   r£   c                   ó   € ] tR tRtRtRtR# )ÚTLSErroria  z
TLS base exception.
r/   Nr    r/   r$   r"   r°   r°   a  ó   † õr$   r°   c                   ó   € ] tR tRtRtRtR# )Ú	TLSFailedig  z-
Exception indicating failed TLS negotiation
r/   Nr    r/   r$   r"   r³   r³   g  r±   r$   r³   c                   ó   € ] tR tRtRtRtR# )ÚTLSRequiredim  z²
Exception indicating required TLS negotiation.

This exception is raised when the receiving entity requires TLS
negotiation and the initiating does not desire to negotiate TLS.
r/   Nr    r/   r$   r"   rµ   rµ   m  ó   † õr$   rµ   c                   ó   € ] tR tRtRtRtR# )ÚTLSNotSupportediv  z¯
Exception indicating missing TLS support.

This exception is raised when the initiating entity wants and requires to
negotiate TLS when the OpenSSL library is not available.
r/   Nr    r/   r$   r"   r¸   r¸   v  r¶   r$   r¸   c                   ó`   a a€ ] tR tRt oRt]R3tRtRtRt	RV 3R llt
R tR tR	 tR
tVtV ;t# )ÚTLSInitiatingInitializeri  aæ  
TLS stream initializer for the initiating entity.

It is strongly required to include this initializer in the list of
initializers for an XMPP stream. By default it will try to negotiate TLS.
An XMPP server may indicate that TLS is required. If TLS is not desired,
set the C{wanted} attribute to False instead of removing it from the list
of initializers, so a proper exception L{TLSRequired} can be raised.

@ivar wanted: indicates if TLS negotiation is wanted.
@type wanted: C{bool}
ÚstarttlsTNc                ó4   <€ \         SV `  WR7       W0n        R# )aä  
@param configurationForTLS: An object which creates appropriately
    configured TLS connections. This is passed to C{startTLS} on the
    transport and is preferably created using
    L{twisted.internet.ssl.optionsForClientTLS}.  If C{None}, the
    default is to verify the server certificate against the trust roots
    as provided by the platform. See
    L{twisted.internet._sslverify.platformTrust}.
@type configurationForTLS: L{IOpenSSLClientConnectionCreator} or
    C{None}
)r¥   N)Úsuperr,   Ú_configurationForTLS)r+   r¦   r¥   ÚconfigurationForTLSÚ	__class__s   &&&&€r"   r,   Ú!TLSInitiatingInitializer.__init__’  s   ø€ ô 	‰Ñ˜ÐÔ/Ø$7Ö!r$   c                óæ  € V P                   P                  RV P                  4       V P                  '       d   V P                  pM3\        P                  V P                   P                  P                  4      pV P                   P                  P                  V4       V P                   P                  4        V P                   P                  4        V P                  P                  \        4       R# )z8
Proceed with TLS negotiation and reset the XML stream.
ú/failureN)r   ÚremoveObserverÚ	onFailurer¾   r   ÚoptionsForClientTLSrV   ÚhostÚ	transportÚstartTLSÚresetrW   Ú	_deferredÚcallbackra   )r+   ÚobjÚctxs   && r"   Ú	onProceedÚ"TLSInitiatingInitializer.onProceed¡  s�   € ð
 	�‰×%Ñ% j°$·.±.ÔAØ×$×$Ð$Ø×+Ñ+‰Cä×)Ñ)¨$¯.©.×*DÑ*D×*IÑ*IÓJˆCØ�‰× Ñ ×)Ñ)¨#Ô.Ø�‰×ÑÔØ�‰×!Ñ!Ô#Ø�‰×Ñ¤Ö&r$   c                ó˜   € V P                   P                  R V P                  4       V P                  P	                  \        4       4       R# )ú/proceedN)r   rÄ   rÏ   rË   Úerrbackr³   ©r+   rÍ   s   &&r"   rÅ   Ú"TLSInitiatingInitializer.onFailure°  s.   € Ø�‰×%Ñ% j°$·.±.ÔAØ�‰×Ñœy›{Ö+r$   c                óè  € V P                   '       dP   \        fG   V P                  '       d   \        P                  ! \        4       4      # \        P                  ! R4      # MkV P                  P                  V P                  ,          P                  '       d   \        P                  ! \        4       4      # \        P                  ! R4      # \        P                  ! 4       T n        T P                  P                  RT P                  4       T P                  P                  RT P                  4       T P                  P!                  \"        P$                  ! \&        R34      4       T P                  # )a·  
Start TLS negotiation.

This checks if the receiving entity requires TLS, the SSL library is
available and uses the C{required} and C{wanted} instance variables to
determine what to do in the various different cases.

For example, if the SSL library is not available, and wanted and
required by the user, it raises an exception. However if it is not
required by both parties, initialization silently succeeds, moving
on to the next step.
NrÒ   rÃ   r»   )Úwantedr   r¥   r	   Úfailr¸   rk   r   rw   ry   rµ   ÚDeferredrË   r   rÏ   rÅ   Úsendr   ÚElementÚNS_XMPP_TLSr*   s   &r"   r©   ÚTLSInitiatingInitializer.start´  sæ   € ð �;�;ˆ;ÜŠ{Ø—=—=�=Ü Ÿ:š:¤oÓ&7Ó8Ð8ä Ÿ=š=¨Ó.Ð.àØ�^‰^×$Ñ$ T§\¡\Õ2×;×;Ð;Ü—:’:œk›mÓ,Ð,ä—=’= Ó&Ð&äŸšÓ)ˆŒØ�‰×)Ñ)¨*°d·n±nÔEØ�‰×)Ñ)¨*°d·n±nÔEØ�‰×ÑœFŸNšN¬K¸Ð+DÓEÔFØ�~‰~Ðr$   )r¾   rË   )TN)rD   rE   rF   rG   rH   rÜ   ry   r×   rË   r¾   r,   rÏ   rÅ   r©   rI   rJ   Ú__classcell__)rÀ   rL   s   @@r"   rº   rº     s?   ù‡ € ñð ˜JÐ'€GØ€FØ€IØÐ÷8ò'ò,÷ò r$   rº   c                   ó|   a € ] tR tRt o RtRtRtRtRtRt	Rt
RtR tR tR	 tR
 tR tR tR tR tR tR tRtV tR# )Ú	XmlStreamiÕ  a  
XMPP XML Stream protocol handler.

@ivar version: XML stream version as a tuple (major, minor). Initially,
               this is set to the minimally supported version. Upon
               receiving the stream header of the peer, it is set to the
               minimum of that value and the version on the received
               header.
@type version: (C{int}, C{int})
@ivar namespace: default namespace URI for stream
@type namespace: C{unicode}
@ivar thisEntity: JID of this entity
@type thisEntity: L{JID}
@ivar otherEntity: JID of the peer entity
@type otherEntity: L{JID}
@ivar sid: session identifier
@type sid: C{unicode}
@ivar initiating: True if this is the initiating stream
@type initiating: C{bool}
@ivar features: map of (uri, name) to stream features element received from
                the receiving entity.
@type features: C{dict} of (C{unicode}, C{unicode}) to L{domish.Element}.
@ivar prefixes: map of URI to prefixes that are to appear on stream
                header.
@type prefixes: C{dict} of C{unicode} to C{unicode}
@ivar initializers: list of stream initializer objects
@type initializers: C{list} of objects that provide L{IInitializer}
@ivar authenticator: associated authenticator that uses C{initializers} to
                     initialize the XML stream.
ÚinvalidNTFc                ó¨   € \         P                  P                  V 4       \        R /V n        Wn        . V n        / V n        VP                  V 4       R# )ÚstreamN)	r   rà   r,   r€   r•   Úauthenticatorr[   rw   rB   ©r+   rä   s   &&r"   r,   ÚXmlStream.__init__þ  sG   € Ü×Ñ×$Ñ$ TÔ*ä# XÐ.ˆŒØ*ÔØˆÔØˆŒð 	×)Ñ)¨$Ö/r$   c                ó2   € ^ RI Hp VP                  ! V/ VB # )r6   )Úreactor)Útwisted.internetrè   Ú	callLater)r+   ÚargsÚkwargsrè   s   &*, r"   Ú
_callLaterÚXmlStream._callLater	  s   € Ý,à× Ò  $Ð1¨&Ñ1Ð1r$   c                ó4   € RV n         V P                  4        R# )zÒ
Reset XML Stream.

Resets the XML Parser for incoming data. This is to be used after
successfully negotiating a new layer, e.g. TLS and SASL. Note that
registered event observers will continue to be in place.
FN)Ú_headerSentÚ_initializeStreamr*   s   &r"   rÊ   ÚXmlStream.reset  s   € ð !ˆÔØ×ÑÖ r$   c                ó¶   € V P                  \        P                  ! \        P                  ! V4      4      \
        4       V P                  P                  4        R# )zý
Called when a stream:error element has been received.

Dispatches a L{STREAM_ERROR_EVENT} event with the error element to
allow for cleanup actions and drops the connection.

@param errelem: The received error element.
@type errelem: L{domish.Element}
N)re   r   ÚFailurer   ÚexceptionFromStreamErrorr   rÈ   ÚloseConnection)r+   Úerrelems   &&r"   ÚonStreamErrorÚXmlStream.onStreamError  s<   € ð 	�‰Ü�OŠOœE×:Ò:¸7ÓCÓDÔFXô	
ð 	�‰×%Ñ%Ö'r$   c                óš  € / pV P                   P                  4        F  w  r#V\        8w  g   K  W!V&   K  	  \        P                  ! \        R3V P
                  VR7      pV P                  '       d   V P                  P                  4       VR&   V P                  '       d   V P                  P                  4       VR&   V P                  '       g"   V P                  '       d   V P                  VR&   V P                  R8¼  d   RV P                  ,          VR&   V P                  VP                  V P                   ^ R7      4       R	V n        R
# )z
Send stream header.
rã   )r–   r‘   rr   rq   z%d.%dr4   )r•   ÚcloseElementTNr|   )r•   r—   r€   r   rÛ   rT   rV   Úuserhostr”   rŽ   r   r4   rÚ   ÚtoXmlrð   )r+   r–   ru   rš   r=   s   &    r"   rW   ÚXmlStream.sendHeader(  sÿ   € ð
 ˆØŸ=™=×.Ñ.Ö0‰KˆCØ”jÖ Ø(+˜fÓ%ñ 1ô —n’nÜ˜Ð" D§N¡NÀ-ô
ˆð ××ÐØ $× 0Ñ 0× 9Ñ 9Ó ;ˆK˜Ñà�?�?ˆ?Ø"&§/¡/×":Ñ":Ó"<ˆK˜Ñà��ˆ 4§8§8 8Ø $§¡ˆK˜Ñà�<‰<˜6Ô!Ø%,¨t¯|©|Õ%;ˆK˜	Ñ"à�	‰	�+×#Ñ#¨T¯]©]ÈÐ#ÓKÔLØˆÖr$   c                ó(   € V P                  R4       R# )z
Send stream footer.
z</stream:stream>N)rÚ   r*   s   &r"   Ú
sendFooterÚXmlStream.sendFooterE  s   € ð 	�	‰	Ð$Ö%r$   c                ó$  € V P                   '       g#   V P                  '       g   V P                  4        V P                   '       d0   V P                  VP	                  4       4       V P                  4        V P                  P                  4        R# )a  
Send stream level error.

If we are the receiving entity, and haven't sent the header yet,
we sent one first.

After sending the stream error, the stream is closed and the transport
connection dropped.

@param streamError: stream error instance
@type streamError: L{error.StreamError}
N)rð   rŽ   rW   rÚ   Ú
getElementr   rÈ   rö   )r+   ÚstreamErrors   &&r"   ÚsendStreamErrorÚXmlStream.sendStreamErrorK  s]   € ð ××Ð¨¯¯¨Ø�O‰OÔà××ÐØ�I‰I�k×,Ñ,Ó.Ô/Ø�O‰OÔà�‰×%Ñ%Ö'r$   c                ó   € \         P                  P                  V4      '       dJ   VP                  V P                  V P
                  \        V P                  P                  4       4      R7      p\        P                  P                  W4       R# )a&  
Send data over the stream.

This overrides L{xmlstream.XmlStream.send} to use the default namespace
of the stream header when serializing L{domish.IElement}s. It is
assumed that if you pass an object that provides L{domish.IElement},
it represents a direct child of the stream's root element.
)r•   r“   ÚprefixesInScopeN)r   ÚIElementÚ
providedByrý   r•   rT   ÚlistÚvaluesr   rà   rÚ   rÔ   s   &&r"   rÚ   ÚXmlStream.senda  se   € ô �?‰?×%Ñ% c×*Ò*Ø—)‘)ØŸ™ØŸ>™>Ü $ T§]¡]×%9Ñ%9Ó%;Ó <ð ó ˆCô 	×Ñ× Ñ  Ö+r$   c                óx   € \         P                  P                  V 4       V P                  P                  4        R# )z`
Called when a connection is made.

Notifies the authenticator when a connection has been made.
N)r   rà   r0   rä   r*   s   &r"   r0   ÚXmlStream.connectionMades  s*   € ô 	×Ñ×*Ñ*¨4Ô0Ø×Ñ×)Ñ)Ö+r$   c                óÈ   € \         P                  P                  W4       V P                  R\        ,          V P
                  4       V P                  P                  V4       R# )a'  
Called when the stream header has been received.

Extracts the header's C{id} and C{version} attributes from the root
element. The C{id} attribute is stored in our C{sid} attribute and the
C{version} attribute is parsed and the minimum of the version we sent
and the parsed C{version} attribute is stored as a tuple (major, minor)
in this class' C{version} attribute. If no C{version} attribute was
present, we assume version 0.0.

If appropriate (we are the initiating stream and the minimum of our and
the other party's version is at least 1.0), a one-time observer is
registered for getting the stream features. The registered function is
C{onFeatures}.

Ultimately, the authenticator's C{streamStarted} method will be called.

@param rootElement: The root element.
@type rootElement: L{domish.Element}
z/error[@xmlns='%s']N)r   rà   ÚonDocumentStartr   r€   rø   rä   r>   )r+   r=   s   &&r"   r  ÚXmlStream.onDocumentStart|  sJ   € ô* 	×Ñ×+Ñ+¨DÔ>ð 	×ÑÐ 5¼
Õ BÀD×DVÑDVÔWà×Ñ×(Ñ(¨Ö5r$   )rð   rä   rw   r[   r•   r|   )rD   rE   rF   rG   rH   r4   rT   r”   rV   r   rŽ   rð   r,   rí   rÊ   rø   rW   r   r  rÚ   r0   r  rI   rJ   rK   s   @r"   rà   rà   Õ  sf   ø‡ € ñð> €GØ€IØ€JØ€KØ
€CØ€Jà€Kò	0ò2ò
	!ò(ò ò:&ò(ò,,ò$,÷6ð 6r$   rà   c                   ó.   a € ] tR tRt o Rt]tR tRtV t	R# )ÚXmlStreamFactoryi™  zÑ
Factory for Jabber XmlStream objects as a reconnecting client.

Note that this differs from L{xmlstream.XmlStreamFactory} in that
it generates Jabber specific L{XmlStream} instances that have
authenticators.
c                óP   € \         P                  P                  W4       Wn        R # r(   )r   r  r,   rä   rå   s   &&r"   r,   ÚXmlStreamFactory.__init__¤  s   € Ü×"Ñ"×+Ñ+¨DÔ@Ø*Ör$   )rä   N)
rD   rE   rF   rG   rH   rà   r
   r,   rI   rJ   rK   s   @r"   r  r  ™  s   ø‡ € ñð €H÷+ð +r$   r  c                   ó4   a € ] tR tRt o Rt]tR tR tRt	V t
R# )ÚXmlStreamServerFactoryi©  a  
Factory for Jabber XmlStream objects as a server.

@since: 8.2.
@ivar authenticatorFactory: Factory callable that takes no arguments, to
                            create a fresh authenticator to be associated
                            with the XmlStream.
c                óP   € \         P                  P                  V 4       Wn        R # r(   )r   ÚBootstrapMixinr,   ÚauthenticatorFactory)r+   r  s   &&r"   r,   ÚXmlStreamServerFactory.__init__¶  s   € Ü× Ñ ×)Ñ)¨$Ô/Ø$8Ö!r$   c                óv   € V P                  4       pV P                  V4      pWn        V P                  V4       V# )z­
Create an instance of XmlStream.

A new authenticator instance will be created and passed to the new
XmlStream. Registered bootstrap event observers are installed as well.
)r  r
   ÚfactoryÚinstallBootstraps)r+   Úaddrrä   r¦   s   &&  r"   ÚbuildProtocolÚ$XmlStreamServerFactory.buildProtocolº  s8   € ð ×1Ñ1Ó3ˆØ�]‰]˜=Ó)ˆØŒ
Ø×Ñ˜rÔ"Øˆ	r$   )r  N)rD   rE   rF   rG   rH   rà   r
   r,   r!  rI   rJ   rK   s   @r"   r  r  ©  s    ø‡ € ñð €Hò9÷ð r$   r  c                   ó   € ] tR tRtRtRtR# )ÚTimeoutErroriÈ  zW
Exception raised when no IQ response has been received before the
configured timeout.
r/   Nr    r/   r$   r"   r$  r$  È  r¡   r$   r$  c                ó  a € V 3R lpV 3R lp/ S n         \        S RR4      S n        S P                  \        P
                  V4       S P                  RV4       S P                  RV4       \        S \        P                  4       R# )a  
Enhances an XmlStream for iq response tracking.

This makes an L{XmlStream} object provide L{IIQResponseTracker}. When a
response is an error iq stanza, the deferred has its errback invoked with a
failure that holds a L{StanzaError<error.StanzaError>} that is
easier to examine.
c                óN  <€ \        V RR4      '       d   R#  SP                  V R,          ,          pSP                  V R,           RV n        V R,          R8X  d(   VP                  \        P
                  ! V 4      4       R# VP                  V 4       R#   \         d     R# i ; i)z3
Handle iq response by firing associated deferred.
ÚhandledFNrq   TÚtyper   )ÚgetattrÚiqDeferredsr'  rÓ   r   ÚexceptionFromStanzarÌ   ÚKeyError)Úiqrh   r¦   s   & €r"   rÌ   Ú.upgradeWithIQResponseTracker.<locals>.callbackÙ  s‰   ø€ ô �2�y %×(Ò(Ùð
	Ø—‘˜r $�xÕ(ˆAð —‘˜r $�xÐ(ØˆBŒJØ�&�z˜WÔ$Ø—	‘	œ%×3Ò3°BÓ7Ö8à—
‘
˜2–øô ô 	Úð	ús   ˜B ÂB$Â#B$c                óŽ   <€ SP                   p/ Sn         VP                  4        F  pVP                  \        4       4       K  	  R# )zÕ
Make sure deferreds do not linger on after disconnect.

This errbacks all deferreds of iq's for which no response has been
received with a L{ConnectionLost} failure. Otherwise, the deferreds
will never be fired.
N)r*  r  rÓ   r   )Ú_r*  rh   r¦   s   &  €r"   ÚdisconnectedÚ2upgradeWithIQResponseTracker.<locals>.disconnectedì  s7   ø€ ð —n‘nˆØˆŒØ×#Ñ#Ö%ˆAØ�I‰I”nÓ&Ö'ó &r$   ÚiqDefaultTimeoutNz/iq[@type="result"]z/iq[@type="error"])	r*  r)  r3  ÚaddObserverr   r   r   r   ÚIIQResponseTracker)r¦   rÌ   r1  s   f  r"   ÚupgradeWithIQResponseTrackerr6  Ï  sj   ø€ õõ&(ð €B„NÜ! "Ð&8¸$Ó?€BÔØ‡N�N”9×-Ñ-¨|Ô<Ø‡N�NÐ(¨(Ô3Ø‡N�NÐ'¨Ô2Ü�Rœ×3Ñ3Ö4r$   c                   ó<   a € ] tR tRt o RtRtRR ltRR ltRtV t	R# )	ÚIQi  aœ  
Wrapper for an iq stanza.

Iq stanzas are used for communications with a request-response behaviour.
Each iq request is associated with an XML stream and has its own unique id
to be able to track the response.

@ivar timeout: if set, a timeout period after which the deferred returned
               by C{send} will have its errback called with a
               L{TimeoutError} failure.
@type timeout: C{float}
Nc                óz   € \         P                  P                  V R4       V P                  4        W R&   Wn        R# )z¹
@type xmlstream: L{xmlstream.XmlStream}
@param xmlstream: XmlStream to use for transmission of this IQ

@type stanzaType: C{str}
@param stanzaType: IQ type identifier ('get' or 'set')
Nr(  )Nr-  )r   rÛ   r,   ÚaddUniqueIdÚ
_xmlstream)r+   r   Ú
stanzaTypes   &&&r"   r,   ÚIQ.__init__  s0   € ô 	�‰×Ñ  lÔ3Ø×ÑÔØ!ˆV‰Ø#Žr$   c                ó  a aa€ Ve   VS R&   \         P                  P                  S P                  4      '       g   \	        S P                  4       \
        P                  ! 4       oSS P                  P                  S R,          &   S P                  ;'       g    S P                  P                  pVe:   VV 3R lpS P                  P                  W#4      oV3R lpSP                  V4       S P                  P                  S 4       S# )aB  
Send out this iq.

Returns a deferred that is fired when an iq response with the same id
is received. Result responses will be passed to the deferred callback.
Error responses will be transformed into a
L{StanzaError<error.StanzaError>} and result in the errback of the
deferred being invoked.

@rtype: L{defer.Deferred}
r‘   rq   c                  óx   <€ SP                   P                  SR ,           S P                  \        R4      4       R# )rq   zIQ timed outN)r;  r*  rÓ   r$  )rh   r+   s   €€r"   Ú	onTimeoutÚIQ.send.<locals>.onTimeout6  s*   ø€ Ø—O‘O×/Ñ/°°Tµ
Ð;Ø—	‘	œ, ~Ó6Ö7r$   c                 óT   <€ SP                  4       '       d   SP                  4        V # r(   )ÚactiveÚcancel)r]   Úcalls   &€r"   ÚcancelTimeoutÚIQ.send.<locals>.cancelTimeout<  s   ø€ Ø—;‘;—=’=Ø—K‘K”Mà�r$   )r   r5  r
  r;  r6  r	   rÙ   r*  Útimeoutr3  rí   ÚaddBothrÚ   )r+   r‘   rH  r@  rF  rE  rh   s   f&   @@r"   rÚ   ÚIQ.send  sÄ   ú€ ð Š>ØˆD�‰Jä×)Ñ)×4Ñ4°T·_±_×EÒEÜ(¨¯©Ô9ä�NŠNÓˆØ23ˆ�‰×#Ñ# D¨¥JÑ/à—,‘,×BÐB $§/¡/×"BÑ"BˆØÒö8ð —?‘?×-Ñ-¨gÓAˆDõð �I‰I�mÔ$à�‰×Ñ˜TÔ"Øˆr$   )r;  )Úsetr(   )
rD   rE   rF   rG   rH   rH  r,   rÚ   rI   rJ   rK   s   @r"   r8  r8    s    ø‡ € ñð €Gô$÷'ò 'r$   r8  c                ó  € V P                  R4      pV P                  R4      pV P                  R4      p\        P                  ! RV P                  34      pV'       d   W%R&   V'       d   W5R&   V'       d   WER&   V'       d   WR&   V# )aÑ  
Create a response stanza from another stanza.

This takes the addressing and id attributes from a stanza to create a (new,
empty) response stanza. The addressing attributes are swapped and the id
copied. Optionally, the stanza type of the response can be specified.

@param stanza: the original stanza
@type stanza: L{domish.Element}
@param stanzaType: optional response stanza type
@type stanzaType: C{str}
@return: the response stanza.
@rtype: L{domish.Element}
rr   r‘   rq   Nr(  )r~   r   rÛ   rv   )Ústanzar<  ÚtoAddrÚfromAddrÚstanzaIDÚresponses   &&    r"   Ú
toResponserR  H  sz   € ð  × Ñ  Ó(€FØ×"Ñ" 4Ó(€HØ×"Ñ" 4Ó(€Hä�~Š~˜t V§[¡[Ð1Ó2€HßØ�‰ßØ#�ÑßØ!�‰ßØ%�Ñà€Or$   c                   óT   a € ] tR tRt o RtR tR tR tR tR t	R t
R	 tR
 tRtV tR# )ÚXMPPHandlerii  z¨
XMPP protocol handler.

Classes derived from this class implement (part of) one or more XMPP
extension protocols, and are referred to as a subprotocol implementation.
c                ó"   € R V n         R V n        R # r(   ©Úparentr   r*   s   &r"   r,   ÚXMPPHandler.__init__r  s   € ØˆŒØˆŽr$   c                óH   € Wn         V P                   P                  V 4       R # r(   )rW  Ú
addHandler©r+   rW  s   &&r"   ÚsetHandlerParentÚXMPPHandler.setHandlerParentv  s   € ØŒØ�‰×Ñ˜tÖ$r$   c                óJ   € V P                   P                  V 4       R V n         R # r(   )rW  ÚremoveHandlerr[  s   &&r"   ÚdisownHandlerParentÚXMPPHandler.disownHandlerParentz  s   € Ø�‰×!Ñ! $Ô'ØˆŽr$   c                ó2   € Wn         V P                  4        R # r(   )r   r0   )r+   r¦   s   &&r"   ÚmakeConnectionÚXMPPHandler.makeConnection~  s   € ØŒØ×ÑÖr$   c                ó   € R# )zr
Called after a connection has been established.

Can be overridden to perform work before stream initialization.
Nr/   r*   s   &r"   r0   ÚXMPPHandler.connectionMade‚  r2   r$   c                ó   € R# )z¡
The XML stream has been initialized.

Can be overridden to perform work after stream initialization, e.g. to
set up observers and start exchanging XML stanzas.
Nr/   r*   s   &r"   ÚconnectionInitializedÚ!XMPPHandler.connectionInitialized‰  r2   r$   c                ó   € RV n         R# )zo
The XML stream has been closed.

This method can be extended to inspect the C{reason} argument and
act on it.
Nr)   ©r+   Úreasons   &&r"   ÚconnectionLostÚXMPPHandler.connectionLost‘  s   € ð ˆŽr$   c                ó<   € V P                   P                  V4       R# )a[  
Send data over the managed XML stream.

@note: The stream manager maintains a queue for data sent using this
       method when there is no current initialized XML stream. This
       data is then sent as soon as a new stream has been established
       and initialized. Subsequently, L{connectionInitialized} will be
       called again. If this queueing is not desired, use C{send} on
       C{self.xmlstream}.

@param obj: data to be sent over the XML stream. This is usually an
            object providing L{domish.IElement}, or serialized XML. See
            L{xmlstream.XmlStream} for details.
N)rW  rÚ   rÔ   s   &&r"   rÚ   ÚXMPPHandler.sendš  s   € ð 	�‰×Ñ˜Ör$   rV  N)rD   rE   rF   rG   rH   r,   r\  r`  rc  r0   rh  rm  rÚ   rI   rJ   rK   s   @r"   rT  rT  i  s7   ø‡ € ñòò%òòòòò÷ð r$   rT  c                   ó<   a € ] tR tRt o RtR tR tR tR tRt	V t
R# )	ÚXMPPHandlerCollectioni¬  a  
Collection of XMPP subprotocol handlers.

This allows for grouping of subprotocol handlers, but is not an
L{XMPPHandler} itself, so this is not recursive.

@ivar handlers: List of protocol handlers.
@type handlers: C{list} of objects providing
                  L{IXMPPHandler}
c                ó   € . V n         R # r(   ©Úhandlersr*   s   &r"   r,   ÚXMPPHandlerCollection.__init__¹  s	   € ØˆŽr$   c                ó,   € \        V P                  4      # )z"
Act as a container for handlers.
)Úiterru  r*   s   &r"   Ú__iter__ÚXMPPHandlerCollection.__iter__¼  s   € ô �D—M‘MÓ"Ð"r$   c                ó<   € V P                   P                  V4       R# )z[
Add protocol handler.

Protocol handlers are expected to provide L{ijabber.IXMPPHandler}.
N)ru  Úappend©r+   Úhandlers   &&r"   rZ  Ú XMPPHandlerCollection.addHandlerÂ  s   € ð 	�‰×Ñ˜WÖ%r$   c                ó<   € V P                   P                  V4       R# )z
Remove protocol handler.
N)ru  Úremover}  s   &&r"   r_  Ú#XMPPHandlerCollection.removeHandlerÊ  s   € ð 	�‰×Ñ˜WÖ%r$   rt  N)rD   rE   rF   rG   rH   r,   ry  rZ  r_  rI   rJ   rK   s   @r"   rr  rr  ¬  s#   ø‡ € ñ	òò#ò&÷&ð &r$   rr  c                   óR   a € ] tR tRt o RtRtR tR tR tR t	R t
R	 tR
 tRtV tR# )ÚStreamManageriÑ  aì  
Business logic representing a managed XMPP connection.

This maintains a single XMPP connection and provides facilities for packet
routing and transmission. Business logic modules are objects providing
L{ijabber.IXMPPHandler} (like subclasses of L{XMPPHandler}), and added
using L{addHandler}.

@ivar xmlstream: currently managed XML stream
@type xmlstream: L{XmlStream}
@ivar logTraffic: if true, log all traffic.
@type logTraffic: C{bool}
@ivar _initialized: Whether the stream represented by L{xmlstream} has
                    been initialized. This is used when caching outgoing
                    stanzas.
@type _initialized: C{bool}
@ivar _packetQueue: internal buffer of unsent data. See L{send} for details.
@type _packetQueue: C{list}
Fc                óf  € \         P                  V 4       R V n        . V n        RV n        VP                  \        V P                  4       VP                  \        V P                  4       VP                  \        V P                  4       VP                  \        V P                  4       Wn        R # )NF)rr  r,   r   Ú_packetQueueÚ_initializedÚaddBootstrapr   Ú
_connectedrf   Ú_authdrm   ÚinitializationFailedr   Ú_disconnectedr  )r+   r  s   &&r"   r,   ÚStreamManager.__init__è  s„   € Ü×&Ñ& tÔ,ØˆŒØˆÔØ!ˆÔà×ÑÔ3°T·_±_ÔEØ×ÑÔ/°·±Ô=Ø×ÑÔ.°×0IÑ0IÔJØ×ÑÔ-¨t×/AÑ/AÔBØŽr$   c                óÖ   € \         P                  W4       V P                  '       dB   V P                  '       d.   VP	                  V P                  4       VP                  4        R# R# R# )z–
Add protocol handler.

When an XML stream has already been established, the handler's
C{connectionInitialized} will be called to get it up to speed.
N)rr  rZ  r   r‡  rc  rh  r}  s   &&r"   rZ  ÚStreamManager.addHandlerô  sM   € ô 	×(Ñ(¨Ô7ð �>�>ˆ>˜d×/×/Ð/Ø×"Ñ" 4§>¡>Ô2Ø×)Ñ)Ö+ñ 0‰>r$   c                óŽ   € R pR pV P                   '       d   W!n        W1n        Wn        V  F  pVP	                  V4       K  	  R# )zÕ
Called when the transport connection has been established.

Here we optionally set up traffic logging (depending on L{logTraffic})
and call each handler's C{makeConnection} method with the L{XmlStream}
instance.
c                 ó@   € \         P                  ! R V ,          4       R# )zRECV: %rN©r   Úmsg©Úbufs   &r"   Ú	logDataInÚ+StreamManager._connected.<locals>.logDataIn  ó   € Ü�GŠG�J Õ$Ö%r$   c                 ó@   € \         P                  ! R V ,          4       R# )zSEND: %rNr’  r”  s   &r"   Ú
logDataOutÚ,StreamManager._connected.<locals>.logDataOut  r˜  r$   N)Ú
logTrafficÚrawDataInFnÚrawDataOutFnr   rc  )r+   r¦   r–  rš  Úes   &&   r"   r‰  ÚStreamManager._connected  s>   € ò	&ò	&ð �?�?ˆ?Ø&ŒNØ(ŒOàŒãˆAØ×Ñ˜RÖ ó r$   c                óœ   € V P                    F  pVP                  V4       K  	  . V n         RV n        V  F  pVP                  4        K  	  R# )z€
Called when the stream has been initialized.

Send out cached stanzas and call each handler's
C{connectionInitialized} method.
TN)r†  rÚ   r‡  rh  )r+   r¦   ÚprŸ  s   &&  r"   rŠ  ÚStreamManager._authd  sG   € ð ×"Ô"ˆAØ�G‰G�AŽJñ #àˆÔØ ˆÔó ˆAØ×#Ñ#Ö%ó r$   c                ó   € R# )ao  
Called when stream initialization has failed.

Stream initialization has halted, with the reason indicated by
C{reason}. It may be retried by calling the authenticator's
C{initializeStream}. See the respective authenticators for details.

@param reason: A failure instance indicating why stream initialization
               failed.
@type reason: L{failure.Failure}
Nr/   rk  s   &&r"   r‹  Ú"StreamManager.initializationFailed-  r2   r$   c                óV   € RV n         RV n        V  F  pVP                  V4       K  	  R# )zÙ
Called when the stream has been closed.

From this point on, the manager doesn't interact with the
L{XmlStream} anymore and notifies each handler that the connection
was lost by calling its C{connectionLost} method.
NF)r   r‡  rm  )r+   rl  rŸ  s   && r"   rŒ  ÚStreamManager._disconnected:  s-   € ð ˆŒØ!ˆÔó ˆAØ×Ñ˜VÖ$ó r$   c                óš   € V P                   '       d   V P                  P                  V4       R# V P                  P	                  V4       R# )a  
Send data over the XML stream.

When there is no established XML stream, the data is queued and sent
out when a new XML stream has been established and initialized.

@param obj: data to be sent over the XML stream. See
            L{xmlstream.XmlStream.send} for details.
N)r‡  r   rÚ   r†  r|  rÔ   s   &&r"   rÚ   ÚStreamManager.sendJ  s6   € ð ××ÐØ�N‰N×Ñ Ö$à×Ñ×$Ñ$ SÖ)r$   )r‡  r†  r  r   N)rD   rE   rF   rG   rH   rœ  r,   rZ  r‰  rŠ  r‹  rŒ  rÚ   rI   rJ   rK   s   @r"   r„  r„  Ñ  s9   ø‡ € ñð( €Jò
ò,ò!ò0&ò$ò%÷ *ð *r$   r„  r(   )r&   r£   rN   rŸ   rm   r8  rŒ   r€   rÜ   ra   rf   r   r   r   r   r„  r°   r³   rº   r¸   rµ   r$  rT  rr  rà   r  r  r#   rR  r6  )IrH   Úbinasciir   Úhashlibr   Úsysr   Útypingr   r   Úzope.interfacer   r   ré   r	   r
   Útwisted.internet.errorr   Útwisted.pythonr   r   r   Útwisted.words.protocols.jabberr   r   r   Útwisted.words.xishr   r   Útwisted.words.xish.xmlstreamr   r   r   r   r   Ú_sslÚ	supportedÚImportErrorrf   rm   r€   rÜ   Úobjectra   r#   r&   rN   rŒ   Ú	ExceptionrŸ   ÚIInitiatingInitializerr£   r°   r³   rµ   r¸   rº   rà   r  r  ÚServerFactoryr  r$  r6  rÛ   r8  rR  ÚIXMPPHandlerrT  ÚIXMPPHandlerCollectionrr  r„  Ú__all__r/   r$   r"   Ú<module>r¾     s  ðñõ( Ý Ý ß "ç 8ç ,Ý 1ß 2Ñ 2ß >Ñ >ß 0÷ó ðÝ,ð �>�>ˆ>Ø‰à‰áÐ2Ó3Ð ÙÐ4Ó5Ð à/€
Ø/€á‹€ò3÷"P#ñ P#ôf]$˜=ô ]$ô@#P˜-ô #PôL˜9ô ñ ˆW×+Ñ+Ó,÷,ð ,ó -ð,ô^ˆyô ô�ô ô�(ô ô�hô ôSÐ?ô SôlA6�	×#Ñ#ô A6ôH+�y×1Ñ1ô +ô ˜Y×5Ñ5°x×7MÑ7Mô ô>�9ô ò/5ôdDˆ�‰ô DôNñB ˆW×!Ñ!Ó"÷?ð ?ó #ð?ñD ˆW×+Ñ+Ó,÷!&ð !&ó -ð!&ôHF*Ð)ô F*òR‚øðW! ô Ø
ƒCðús   ÁG Ç	G'Ç&G'