Tcl Source Code

Artifact [893bf8e674]
Login

Artifact 893bf8e67499a91f04cb11750f3202ebf5c691e9:

Attachment "http.CopyChunk.not.draining.everything.diff" to ticket [3610253fff] added by kaitzschu 2013-04-08 03:42:16.
--- 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 }