Fix -validate to return as soon as we finish reading headers (can't rely on close...
authorPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 11 Oct 2007 20:14:50 +0000 (20:14 +0000)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Thu, 11 Oct 2007 20:14:50 +0000 (20:14 +0000)
http2.6/http.tcl

index b57cf335f83549eaef97ce413079013c08ea11e0..8d25a7e13c43ca1554440eff5a248111ba98875a 100644 (file)
@@ -979,6 +979,12 @@ proc http::Event {s token} {
             variable encodings
            set state(state) body
 
+            # If doing a HEAD, then we won't get any body
+            if {$state(-validate)} {
+                Eof $token
+                return
+            }
+
             # For non-chunked transfer we may have no body -- in this case we may get
             # no further file event if the connection doesn't close and no more data
             # is sent. We can tell and must finish up now - not later.