Merge pull request #3157 from rgv151/patch-4
Free SSL handler to avoid memory leaks
This commit is contained in:
commit
c9084585dc
1 changed files with 1 additions and 1 deletions
|
|
@ -453,6 +453,7 @@ proc close*(socket: AsyncSocket) =
|
||||||
when defined(ssl):
|
when defined(ssl):
|
||||||
if socket.isSSL:
|
if socket.isSSL:
|
||||||
let res = SslShutdown(socket.sslHandle)
|
let res = SslShutdown(socket.sslHandle)
|
||||||
|
SSLFree(socket.sslHandle)
|
||||||
if res == 0:
|
if res == 0:
|
||||||
discard
|
discard
|
||||||
elif res != 1:
|
elif res != 1:
|
||||||
|
|
@ -567,4 +568,3 @@ when not defined(testing) and isMainModule:
|
||||||
var f = accept(sock)
|
var f = accept(sock)
|
||||||
f.callback = onAccept
|
f.callback = onAccept
|
||||||
runForever()
|
runForever()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue