Overview
| Artifact ID: | f41322095ba663d63ed1e8bb647ec39e8afead87 |
|---|---|
| Ticket: | 2874782fffffffffffffffffffffffffffffffff
http 2.7.2 fails to correctly parse input |
| User & Date: | cwjolly on 2009-10-08 15:04:09 |
Changes
- assignee changed to: "patthoyts"
- cmimetype changed to: "text/plain"
- comment changed to:
The http event handler function does not handle web servers that put in blank lines ahead of the http response header. This is not to standard but I believe the fix I am suggesting does not harm other web servers that do return the status on the first line. I am connecting to a webserver that sends back the following to a GET request : --------------------------- \n \n \n HTTP/1.1 200 File Follows \n ..... ------- without the suggested change the current 2.7.2 version of http.tm files to parse the reply. The status is blank and the metadata holds the contents of the body. This totally screws up the retrieval of elements using the http api. The following change will not set the header until it gets a non blank line. The relevant portions are shown; all other code has been removed for the sake of brevity. The http::Event proc needs to be modified from : # current version 2.7.2 proc http::Event { socket token } { .... if {$state(state) eq "connecting"} { set state(state) "header" if {[catch {gets $sock state(http)} n]} { return [Finish $token $n] } } ... } to : # suggested update proc http::Event { soket token } { .... if {$state(state) eq "connecting"} { if {[catch {gets $sock state(http)} n]} { return [Finish $token $n] } else { if { [string length $state(http) ] > 0 } { set state(state) "header" } } } - foundin changed to: "obsolete: 8.6b1"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "cwjolly"
- subsystem changed to: "29. http Package"
- title changed to: "http 2.7.2 fails to correctly parse input "
- type changed to: "Bug"