summaryrefslogtreecommitdiffstats
path: root/library/http/http.tcl
diff options
context:
space:
mode:
authoraspect <aspect+tclcore@abstracted-spleen.org>2017-02-12 12:57:29 (GMT)
committeraspect <aspect+tclcore@abstracted-spleen.org>2017-02-12 12:57:29 (GMT)
commit55cb4d9026c1222d6c678bdfa8698f49082bfd92 (patch)
treeffe35b39b3c3c39397510c34e6bbb7c40692ceeb /library/http/http.tcl
parent9b8fe92d1ec10b1010d91d504deab315538cce0e (diff)
downloadtcl-55cb4d9026c1222d6c678bdfa8698f49082bfd92.zip
tcl-55cb4d9026c1222d6c678bdfa8698f49082bfd92.tar.gz
tcl-55cb4d9026c1222d6c678bdfa8698f49082bfd92.tar.bz2
fix chan leak with http keepalive vs close (bug [6ca52aec14])bug_6ca52aec14
Diffstat (limited to 'library/http/http.tcl')
-rw-r--r--library/http/http.tcl7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl
index ccd4cd1..19799b9 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -197,9 +197,10 @@ proc http::Finish {token {errormsg ""} {skipCB 0}} {
set state(error) [list $errormsg $errorInfo $errorCode]
set state(status) "error"
}
- if {
- ($state(status) eq "timeout") || ($state(status) eq "error") ||
- ([info exists state(connection)] && ($state(connection) eq "close"))
+ if { ($state(status) eq "timeout")
+ || ($state(status) eq "error")
+ || ([info exists state(-keepalive)] && !$state(-keepalive))
+ || ([info exists state(connection)] && ($state(connection) eq "close"))
} {
CloseSocket $state(sock) $token
}