remove error debug statement,use stderr instead
isinstance, instead of __class__.__name__
This commit is contained in:
parent
29ab60eaa7
commit
81873919c5
2 changed files with 7 additions and 7 deletions
|
@ -39,9 +39,9 @@ class NBCommonClient(CommonClient):
|
||||||
Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket',
|
Full list: ['nodebuilder', 'dispatcher', 'gen_auth', 'SASL_auth', 'bind', 'socket',
|
||||||
'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] . '''
|
'CONNECTproxy', 'TLS', 'roster', 'browser', 'ibb'] . '''
|
||||||
|
|
||||||
if self.__class__.__name__ == 'NonBlockingClient':
|
if isinstance(self, NonBlockingClient):
|
||||||
self.Namespace, self.DBG = 'jabber:client', DBG_CLIENT
|
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.Namespace, self.DBG = dispatcher_nb.NS_COMPONENT_ACCEPT, DBG_COMPONENT
|
||||||
|
|
||||||
self.defaultNamespace = self.Namespace
|
self.defaultNamespace = self.Namespace
|
||||||
|
@ -66,7 +66,6 @@ class NBCommonClient(CommonClient):
|
||||||
self.socket = None
|
self.socket = None
|
||||||
self.on_connect = on_connect
|
self.on_connect = on_connect
|
||||||
self.on_connect_failure = on_connect_failure
|
self.on_connect_failure = on_connect_failure
|
||||||
#~ self.RegisterDisconnectHandler(self.DisconnectHandler)
|
|
||||||
|
|
||||||
def set_idlequeue(self, idlequeue):
|
def set_idlequeue(self, idlequeue):
|
||||||
self.idlequeue = idlequeue
|
self.idlequeue = idlequeue
|
||||||
|
|
|
@ -203,7 +203,6 @@ class NonBlockingTcp(PlugIn, IdleObject):
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
if len(e.args) > 0 and isinstance(e.args[0], int):
|
if len(e.args) > 0 and isinstance(e.args[0], int):
|
||||||
errnum = e[0]
|
errnum = e[0]
|
||||||
print 'errnum:',errnum, e
|
|
||||||
# "received" will be empty anyhow
|
# "received" will be empty anyhow
|
||||||
if errnum == socket.SSL_ERROR_WANT_READ:
|
if errnum == socket.SSL_ERROR_WANT_READ:
|
||||||
pass
|
pass
|
||||||
|
@ -212,11 +211,13 @@ class NonBlockingTcp(PlugIn, IdleObject):
|
||||||
if self.on_connect_failure:
|
if self.on_connect_failure:
|
||||||
self.on_connect_failure()
|
self.on_connect_failure()
|
||||||
elif not received :
|
elif not received :
|
||||||
if errnum != socket.SSL_ERROR_EOF: # 8 EOF occurred in violation of protocol
|
if errnum != socket.SSL_ERROR_EOF:
|
||||||
self.DEBUG('Socket error while receiving data', 'error')
|
# 8 EOF occurred in violation of protocol
|
||||||
|
print >> sys.stderr, 'Socket error while receiving data'
|
||||||
if self.state >= 0:
|
if self.state >= 0:
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
return False
|
return
|
||||||
|
|
||||||
if self.state < 0:
|
if self.state < 0:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue