mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Forgot the SSLWantRead is a subclass of socket.error
This commit is contained in:
parent
d3586a79a9
commit
3574807c34
@ -232,6 +232,8 @@ class Connection(object): # {{{
|
||||
self.ready = False
|
||||
return 0
|
||||
return bytes_read
|
||||
except ssl.SSLWantReadError:
|
||||
return 0
|
||||
except socket.error as e:
|
||||
if e.errno in socket_errors_nonblocking or e.errno in socket_errors_eintr:
|
||||
return 0
|
||||
@ -239,8 +241,6 @@ class Connection(object): # {{{
|
||||
self.ready = False
|
||||
return 0
|
||||
raise
|
||||
except ssl.SSLWantReadError:
|
||||
return 0
|
||||
|
||||
def fill_read_buffer(self):
|
||||
try:
|
||||
@ -250,6 +250,8 @@ class Connection(object): # {{{
|
||||
# a closed connection is indicated by signaling
|
||||
# a read condition, and having recv() return 0.
|
||||
self.ready = False
|
||||
except ssl.SSLWantReadError:
|
||||
return
|
||||
except socket.error as e:
|
||||
if e.errno in socket_errors_nonblocking or e.errno in socket_errors_eintr:
|
||||
return
|
||||
@ -257,8 +259,6 @@ class Connection(object): # {{{
|
||||
self.ready = False
|
||||
return
|
||||
raise
|
||||
except ssl.SSLWantReadError:
|
||||
return
|
||||
|
||||
def close(self):
|
||||
self.ready = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user