Alexey's patch to disable SASL protocole

This commit is contained in:
Yann Leboulanger 2005-05-24 18:08:37 +00:00
parent 392c1dc7f4
commit e3ddf04b9b
1 changed files with 3 additions and 3 deletions

View File

@ -182,15 +182,15 @@ class Client(CommonClient):
self.connected='tls' self.connected='tls'
return self.connected return self.connected
def auth(self,user,password,resource=''): def auth(self,user,password,resource='',sasl=1):
""" Authenticate connnection and bind resource. If resource is not provided """ Authenticate connnection and bind resource. If resource is not provided
random one or library name used. """ random one or library name used. """
self._User,self._Password,self._Resource=user,password,resource self._User,self._Password,self._Resource=user,password,resource
while not self.Dispatcher.Stream._document_attrs and self.Process(): pass while not self.Dispatcher.Stream._document_attrs and self.Process(): pass
if self.Dispatcher.Stream._document_attrs.has_key('version') and self.Dispatcher.Stream._document_attrs['version']=='1.0': if self.Dispatcher.Stream._document_attrs.has_key('version') and self.Dispatcher.Stream._document_attrs['version']=='1.0':
while not self.Dispatcher.Stream.features and self.Process(): pass # If we get version 1.0 stream the features tag MUST BE presented while not self.Dispatcher.Stream.features and self.Process(): pass # If we get version 1.0 stream the features tag MUST BE presented
auth.SASL().PlugIn(self) if sasl: auth.SASL().PlugIn(self)
if self.SASL.startsasl=='not-supported': if not sasl or self.SASL.startsasl=='not-supported':
if not resource: resource='xmpppy' if not resource: resource='xmpppy'
if auth.NonSASL(user,password,resource).PlugIn(self): if auth.NonSASL(user,password,resource).PlugIn(self):
self.connected+='+old_auth' self.connected+='+old_auth'