summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-12-24 13:03:11 +0100
committerAraq <rumpf_a@web.de>2014-12-24 13:03:11 +0100
commit7aecfb69406eaa11866d0a4ed987b6ef0ffee9f7 (patch)
tree7f9f3ea1f5e9f297f3c72832b7479df863f14d3c /lib
parent2be3f501a1f94d00cb9a74de5ec13cfcb4443b07 (diff)
parent54219245e7602c361ca87a1dfbd150d0fc139990 (diff)
downloadNim-7aecfb69406eaa11866d0a4ed987b6ef0ffee9f7.tar.gz
Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/asyncnet.nim6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/pure/asyncnet.nim b/lib/pure/asyncnet.nim
index fd29e0a22..fc2722c6f 100644
--- a/lib/pure/asyncnet.nim
+++ b/lib/pure/asyncnet.nim
@@ -399,13 +399,13 @@ proc bindAddr*(socket: AsyncSocket, port = Port(0), address = "") {.
 
 proc close*(socket: AsyncSocket) =
   ## Closes the socket.
-  socket.fd.TAsyncFD.closeSocket()
+  defer:
+    socket.fd.TAsyncFD.closeSocket()
   when defined(ssl):
     if socket.isSSL:
       let res = SslShutdown(socket.sslHandle)
       if res == 0:
-        if SslShutdown(socket.sslHandle) != 1:
-          raiseSslError()
+        discard
       elif res != 1:
         raiseSslError()
   socket.closed = true # TODO: Add extra debugging checks for this.