Commit edc0e21d authored by Grégory Wisniewski's avatar Grégory Wisniewski

Handle ECONNRESET from socket level in recv() call because this error can be

triggered even if the man do not say that.


git-svn-id: https://svn.erp5.org/repos/neo/branches/prototype3@561 71dcc9de-d417-0410-9af5-da40c76e7ee4
parent a8aa98cf
......@@ -254,6 +254,11 @@ class Connection(BaseConnection):
assert self.connecting
self.handler.connectionFailed(self)
self.close()
except ConnectorConnectionClosedException:
# connection resetted by peer, according to the man, this error
# should not occurs but it seems it's false
self.handler.connectionClosed(self)
self.close()
except ConnectorException:
self.handler.connectionClosed(self)
self.close()
......
......@@ -97,6 +97,8 @@ class SocketConnector:
raise ConnectorTryAgainException
if err == errno.ECONNREFUSED:
raise ConnectorConnectionRefusedException
if err == errno.ECONNRESET:
raise ConnectorConnectionClosedException
raise ConnectorException, 'receive failed: %s:%s' % (err, errmsg)
def send(self, msg):
......
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