mirror of
https://github.com/openvswitch/ovs
synced 2025-10-19 14:37:21 +00:00
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 Signed-off-by: Guoshuai Li <ligs@dtdream.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
This commit is contained in:
@@ -809,7 +809,9 @@ class SSLStream(Stream):
|
|||||||
buf = buf.encode('utf-8')
|
buf = buf.encode('utf-8')
|
||||||
return super(SSLStream, self).send(buf)
|
return super(SSLStream, self).send(buf)
|
||||||
except SSL.WantWriteError:
|
except SSL.WantWriteError:
|
||||||
return errno.EAGAIN
|
return -errno.EAGAIN
|
||||||
|
except SSL.SysCallError as e:
|
||||||
|
return -ovs.socket_util.get_exception_errno(e)
|
||||||
|
|
||||||
|
|
||||||
if SSL:
|
if SSL:
|
||||||
|
Reference in New Issue
Block a user