Skip to content

Commit 561c80c

Browse files
Release old connection from correct pool (#998)
1 parent b697f46 commit 561c80c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ConnectionPool.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,11 @@ function sslconnection(::Type{SSLContext}, tcp::TCPSocket, host::AbstractString;
536536
return io
537537
end
538538

539-
function sslupgrade(::Type{IOType}, c::Connection,
539+
function sslupgrade(::Type{IOType}, c::Connection{T},
540540
host::AbstractString;
541541
require_ssl_verification::Bool=NetworkOptions.verify_host(host, "SSL"),
542542
readtimeout::Int=0,
543-
kw...)::Connection{IOType} where {IOType}
543+
kw...)::Connection{IOType} where {T, IOType}
544544
# initiate the upgrade to SSL
545545
# if the upgrade fails, an error will be thrown and the original c will be closed
546546
# in ConnectionRequest
@@ -554,7 +554,7 @@ function sslupgrade(::Type{IOType}, c::Connection,
554554
# success, now we turn it into a new Connection
555555
conn = Connection(host, "", 0, require_ssl_verification, tls)
556556
# release the "old" one, but don't allow reuse since we're hijacking the socket
557-
release(getpool(IOType), connectionkey(c), c; return_for_reuse=false)
557+
release(getpool(T), connectionkey(c), c; return_for_reuse=false)
558558
# and return the new one
559559
return acquire(getpool(IOType), connectionkey(conn), conn)
560560
end

0 commit comments

Comments
 (0)