Revert "net: don't clear all errors on close"

You're supposed to clear the error queue before any I/O operations. Per
SSL_get_error(3) man page.

This reverts commit ee3ed37300743addb1344e39bc46d3cd2b89a718.
This commit is contained in:
Leorize 2020-06-03 13:42:12 -05:00 • committed by Andreas Rumpf
commit 19ccce2617

View file

@ -1006,6 +1006,7 @@ proc close*(socket: Socket) =
try:
when defineSsl:
if socket.isSsl and socket.sslHandle != nil:
ErrClearError()
# Don't call SSL_shutdown if the connection has not been fully
# established, see:
# https://github.com/openssl/openssl/issues/710#issuecomment-253897666