remove error debug statement,use stderr instead
isinstance, instead of __class__.__name__
This commit is contained in:
parent
29ab60eaa7
commit
81873919c5
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue