.
--- http.tcl.orig 2013-04-07 23:00:58.421072355 +0300
+++ http.tcl 2013-04-07 23:16:59.517863173 +0300
@@ -1338,7 +1338,12 @@
if {[info exists state(zlib)]} {
set excess ""
foreach stream $state(zlib) {
- catch {set excess [$stream add -finalize $excess]}
+ catch {
+ $stream put -finalize $excess
+ set excess ""
+ set overflood ""
+ while {[set overflood [$stream get]] ne ""} { append excess $overflood }
+ }
}
puts -nonewline $state(-channel) $excess
foreach stream $state(zlib) { $stream close }