From 754bb107b4100f394d445d589dddc94e59dd2d04 Mon Sep 17 00:00:00 2001 From: kjnash Date: Fri, 1 Jun 2018 18:34:07 +0000 Subject: Bugfix - always cleanup persistent socket. --- library/http/http.tcl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/library/http/http.tcl b/library/http/http.tcl index d16a8d9..c177374 100644 --- a/library/http/http.tcl +++ b/library/http/http.tcl @@ -264,8 +264,10 @@ proc http::Finish {token {errormsg ""} {skipCB 0}} { || ([info exists state(-keepalive)] && !$state(-keepalive)) || ([info exists state(connection)] && ($state(connection) eq "close")) } { - CloseSocket $state(sock) $token set closeQueue 1 + set connId $state(socketinfo) + set sock $state(sock) + CloseSocket $state(sock) $token } elseif { ([info exists state(-keepalive)] && $state(-keepalive)) && ([info exists state(connection)] && ($state(connection) ne "close")) @@ -286,11 +288,10 @@ proc http::Finish {token {errormsg ""} {skipCB 0}} { } if { $closeQueue - && [info exists state(socketinfo)] - && [info exists socketMapping($state(socketinfo))] - && ($socketMapping($state(socketinfo)) eq $state(sock)) + && [info exists socketMapping($connId)] + && ($socketMapping($connId) eq $sock) } { - http::CloseQueuedQueries $state(socketinfo) $token + http::CloseQueuedQueries $connId $token } return -- cgit v0.12