Commit 94350c6f authored by Vincent Pelletier's avatar Vincent Pelletier

Add logs for each kind of connection closure caused by remote peer.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@739 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent 6be5487f
......@@ -274,6 +274,7 @@ class Connection(BaseConnection):
try:
data = self.connector.receive()
if not data:
logging.info('Connection %r closed in recv', self.connector)
self.handler.connectionClosed(self)
self.close()
return
......@@ -288,9 +289,11 @@ class Connection(BaseConnection):
except ConnectorConnectionClosedException:
# connection resetted by peer, according to the man, this error
# should not occurs but it seems it's false
logging.info('Connection reset by peer: %r', self.connector)
self.handler.connectionClosed(self)
self.close()
except ConnectorException:
logging.info('Unknown connection error: %r', self.connector)
self.handler.connectionClosed(self)
self.close()
# unhandled connector exception
......@@ -303,6 +306,7 @@ class Connection(BaseConnection):
try:
n = self.connector.send(self.write_buf)
if not n:
logging.info('Connection %r closed in send', self.connector)
self.handler.connectionClosed(self)
self.close()
return
......@@ -311,9 +315,11 @@ class Connection(BaseConnection):
pass
except ConnectorConnectionClosedException:
# connection resetted by peer
logging.info('Connection reset by peer: %r', self.connector)
self.handler.connectionClosed(self)
self.close()
except ConnectorException:
logging.info('Unknown connection error: %r', self.connector)
# unhandled connector exception
self.handler.connectionClosed(self)
self.close()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment