Artifact
095850c12c9fd6aba1e441aa3a988c75efc66139:
Attachment "noheaders.patch" to
ticket [1589887fff]
added by
kaitzschu
2006-11-03 19:38:29.
--- http-2.5.3.tm 2006-11-03 13:07:48.691671000 +0200
+++ http-2.5.3-noheaders.tm 2006-11-03 12:52:58.556429000 +0200
@@ -837,8 +837,36 @@
lappend state(meta) $key [string trim $value]
} elseif {[string match HTTP* $line]} {
set state(http) $line
+ } else {
+ # does not look like a header, broken(?) server
+ set state(state) body
+ # at this point it is impossible to (re)call -handler
+ # generate an error if this is the case
+ if {[info exists state(-handler)]} {
+ Finish $token {can't -handle broken headers} 1
+ return
+ }
+ # modified copy-paste from below!
+ if {[catch {
+ set block $line
+ set n [string length $block]
+ if {$n >= 0} {
+ append state(body) $block
+ }
+ if {$n >= 0} {
+ incr state(currentsize) $n
+ }
+ } err]} {
+ Finish $token $err
+ } else {
+ if {[info exists state(-progress)]} {
+ eval $state(-progress) \
+ {$token $state(totalsize) $state(currentsize)}
}
}
+ # modified copy-paste block is done
+ }
+ }
} else {
if {[catch {
if {[info exists state(-handler)]} {