summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorLeorize <leorize+oss@disroot.org>2020-06-03 13:42:12 -0500
committerAndreas Rumpf <rumpf_a@web.de>2020-06-06 21:11:53 +0200
commit19ccce2617116270c5a83324f5f442fa7d239ee8 (patch)
tree640741abe5a0e93214d21b18436b6fcf33e56104 /lib
parent44d0b4bdfd95a420946d287adacd762bd12ce646 (diff)
downloadNim-19ccce2617116270c5a83324f5f442fa7d239ee8.tar.gz
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/net.nim1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/pure/net.nim b/lib/pure/net.nim
index d807a5112..f7aacfb0c 100644
--- a/lib/pure/net.nim
+++ b/lib/pure/net.nim
@@ -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