Fix an occasional test_ftplib failure, following r79226.
This commit is contained in:
parent
6557aac599
commit
52093b8e57
|
@ -293,7 +293,9 @@ if ssl is not None:
|
|||
try:
|
||||
return super(SSLConnection, self).send(data)
|
||||
except ssl.SSLError, err:
|
||||
if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
|
||||
if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN,
|
||||
ssl.SSL_ERROR_WANT_READ,
|
||||
ssl.SSL_ERROR_WANT_WRITE):
|
||||
return 0
|
||||
raise
|
||||
|
||||
|
@ -301,6 +303,9 @@ if ssl is not None:
|
|||
try:
|
||||
return super(SSLConnection, self).recv(buffer_size)
|
||||
except ssl.SSLError, err:
|
||||
if err.args[0] in (ssl.SSL_ERROR_WANT_READ,
|
||||
ssl.SSL_ERROR_WANT_WRITE):
|
||||
return ''
|
||||
if err.args[0] in (ssl.SSL_ERROR_EOF, ssl.SSL_ERROR_ZERO_RETURN):
|
||||
self.handle_close()
|
||||
return ''
|
||||
|
|
Loading…
Reference in New Issue