From c4973c3dfbdaf6515ce3a226e8ece0798e6423ba Mon Sep 17 00:00:00 2001 From: Jacob Quinn Date: Fri, 10 Oct 2025 18:01:39 -0600 Subject: [PATCH] Remove use of at-async in SSLStream close Should fix #44. I can't quite remember why we called at-async from close to close the underlying IO, but it shouldn't make that much of a difference to run this inline w/o at-async and makes this not cause problems when run in finalizers. --- src/ssl.jl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/ssl.jl b/src/ssl.jl index cd5f0a4..aa52030 100644 --- a/src/ssl.jl +++ b/src/ssl.jl @@ -682,16 +682,10 @@ function Base.close(ssl::SSLStream, shutdown::Bool=true) Base.@lock ssl.lock begin ssl.closed && return ssl.closed = true - if shutdown - try - ssl_disconnect(ssl.ssl) - catch err - @debug "SSL disconnect failed" err - end - end + shutdown && ssl_disconnect(ssl.ssl) free(ssl.ssl) end - @async try + try Base.close(ssl.io) catch e e isa Base.IOError || rethrow()