summaryrefslogtreecommitdiffstats
path: root/library/http/http.tcl
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-05-09 11:30:09 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-05-09 11:30:09 (GMT)
commit4ba2d9a81ad7f1d8b015c4f3f1dd0e6f603ecc3b (patch)
tree06b5a47205631b604a40625661f91c5b670a1110 /library/http/http.tcl
parent57d6529dcc314ab996a90d55270e3dae7dc1f92e (diff)
parent55cb4d9026c1222d6c678bdfa8698f49082bfd92 (diff)
downloadtcl-4ba2d9a81ad7f1d8b015c4f3f1dd0e6f603ecc3b.zip
tcl-4ba2d9a81ad7f1d8b015c4f3f1dd0e6f603ecc3b.tar.gz
tcl-4ba2d9a81ad7f1d8b015c4f3f1dd0e6f603ecc3b.tar.bz2
Fix [6ca52aec14e0b33543d3cd9895f060b852ac4dbc|6ca52aec14]: HTTP package: Memory leak if client requests "Connection: close" but server responses with "Connection: keep-alive"
http: 2.8.10 -> 2.8.11
Diffstat (limited to 'library/http/http.tcl')
-rw-r--r--library/http/http.tcl9
1 files changed, 5 insertions, 4 deletions
diff --git a/library/http/http.tcl b/library/http/http.tcl
index 03751a3..d950441 100644
--- a/library/http/http.tcl
+++ b/library/http/http.tcl
@@ -11,7 +11,7 @@
package require Tcl 8.6-
# Keep this in sync with pkgIndex.tcl and with the install directories in
# Makefiles
-package provide http 2.8.10
+package provide http 2.8.11
namespace eval http {
# Allow resourcing to not clobber existing data
@@ -206,9 +206,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
}