diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-09 11:30:09 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2017-05-09 11:30:09 (GMT) |
commit | f32ecd5894792d7327b82d03ce280b2268ff5233 (patch) | |
tree | 06b5a47205631b604a40625661f91c5b670a1110 /library | |
parent | 46f75926ff14edcf9e58e0f665d1f2cd3a413a3f (diff) | |
parent | c8646e5c72e90d6e78802f41ce39fa603e32e6b3 (diff) | |
download | tcl-f32ecd5894792d7327b82d03ce280b2268ff5233.zip tcl-f32ecd5894792d7327b82d03ce280b2268ff5233.tar.gz tcl-f32ecd5894792d7327b82d03ce280b2268ff5233.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')
-rw-r--r-- | library/http/http.tcl | 9 | ||||
-rw-r--r-- | library/http/pkgIndex.tcl | 2 |
2 files changed, 6 insertions, 5 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 } diff --git a/library/http/pkgIndex.tcl b/library/http/pkgIndex.tcl index 841b4eb..a0d28f1 100644 --- a/library/http/pkgIndex.tcl +++ b/library/http/pkgIndex.tcl @@ -1,2 +1,2 @@ if {![package vsatisfies [package provide Tcl] 8.6-]} {return} -package ifneeded http 2.8.10 [list tclPkgSetup $dir http 2.8.10 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] +package ifneeded http 2.8.11 [list tclPkgSetup $dir http 2.8.11 {{http.tcl source {::http::config ::http::formatQuery ::http::geturl ::http::reset ::http::wait ::http::register ::http::unregister ::http::mapReply}}}] |