python: Catch exception "SSL.SysCallError" for send by SSL.
When OVSDB server is aborted,
the SSL send function will throw SSL.SysCallError exception,
which we need to catch and return it's -errno.
While SSL.WantWriteError exception needs to return -EAGAIN
based on its parent class, not EAGAIN
@@ -809,7 +809,9 @@ class SSLStream(Stream):
buf = buf.encode('utf-8')
return super(SSLStream, self).send(buf)
except SSL.WantWriteError:
- return errno.EAGAIN
+ return -errno.EAGAIN
+ except SSL.SysCallError as e:
+ return -ovs.socket_util.get_exception_errno(e)
if SSL:
