diff --git a/src/common/xmpp/client_nb.py b/src/common/xmpp/client_nb.py index 447e5d476..203a6c87e 100644 --- a/src/common/xmpp/client_nb.py +++ b/src/common/xmpp/client_nb.py @@ -39,9 +39,9 @@ class NBCommonClient(CommonClient): Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket', 'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] . ''' - if self.__class__.__name__ == 'NonBlockingClient': + if isinstance(self, NonBlockingClient): self.Namespace, self.DBG = 'jabber:client', DBG_CLIENT - elif self.__class__.__name__ == 'NBCommonClient': + elif isinstance(self, NBCommonClient): self.Namespace, self.DBG = dispatcher_nb.NS_COMPONENT_ACCEPT, DBG_COMPONENT self.defaultNamespace = self.Namespace @@ -66,7 +66,6 @@ class NBCommonClient(CommonClient): self.socket = None self.on_connect = on_connect self.on_connect_failure = on_connect_failure - #~ self.RegisterDisconnectHandler(self.DisconnectHandler) def set_idlequeue(self, idlequeue): self.idlequeue = idlequeue diff --git a/src/common/xmpp/transports_nb.py b/src/common/xmpp/transports_nb.py index 38a8f1d93..e65b31949 100644 --- a/src/common/xmpp/transports_nb.py +++ b/src/common/xmpp/transports_nb.py @@ -203,7 +203,6 @@ class NonBlockingTcp(PlugIn, IdleObject): except Exception, e: if len(e.args) > 0 and isinstance(e.args[0], int): errnum = e[0] - print 'errnum:',errnum, e # "received" will be empty anyhow if errnum == socket.SSL_ERROR_WANT_READ: pass @@ -212,11 +211,13 @@ class NonBlockingTcp(PlugIn, IdleObject): if self.on_connect_failure: self.on_connect_failure() elif not received : - if errnum != socket.SSL_ERROR_EOF: # 8 EOF occurred in violation of protocol - self.DEBUG('Socket error while receiving data', 'error') + if errnum != socket.SSL_ERROR_EOF: + # 8 EOF occurred in violation of protocol + print >> sys.stderr, 'Socket error while receiving data' if self.state >= 0: self.disconnect() - return False + return + if self.state < 0: return