- 论坛徽章:
- 0
|
使用XMPPPY模块与Jabber服务器通信。
查过资料,是xmpppy的一个sasl验证的Bug。这里有个patch,但好象patch也有问题:
这句 def auth(self,user,password,resource='',sasl=1):里的sasl=1应该改成sasl=0。
下面是原版patch:
Index: client.py
===================================================================
RCS file: /cvsroot/xmpppy/xmpppy/xmpp/client.py,v
retrieving revision 1.37
diff -u -r1.37 client.py
--- client.py 12 May 2005 09:00:23 -0000 1.37
+++ client.py 24 May 2005 13:27:05 -0000
@@ -184,15 +184,15 @@
self.connected='tls'
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
random one or library name used. """
self._User,self._Password,self._Resource=user,password,resource
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':
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 self.SASL.startsasl=='not-supported':
+ if sasl: auth.SASL().PlugIn(self)
+ if not sasl or self.SASL.startsasl=='not-supported':
if not resource: resource='xmpppy'
if auth.NonSASL(user,password,resource).PlugIn(self):
self.connected+='+old_auth'
用了该patch后就可正常连接google talk了。 |
|