From: SourceForge.net <no...@so...> - 2013-01-04 18:55:04
|
Bugs item #3599395, was opened at 2013-01-03 16:30 Message generated for change (Comment added) made by dvrsn You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3599395&group_id=10894 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: 29. http Package Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Jeff Rogers (dvrsn) Assigned to: Pat Thoyts (patthoyts) Summary: http assumes status line is a proper tcl list Initial Comment: The http package implicitly assumes that the response status line is a proper tcl list. The http specification does not guarantee this: Status-Line = HTTP-Version SP Status-Code SP Reason-Phrase CRLF Reason-Phrase = *<TEXT, excluding CR, LF> If the http status like is, for example HTTP/1.0 200 This server is "ok", for now http::geturl will choke on it with an error like list element in quotes followed by "," instead of space while executing "lindex $state(http) 1" (procedure "http::Event" line 26) invoked from within "http::Event sock6 ::http::2" The line at fault appears to be if {$state(http) == "" || [lindex $state(http) 1] == 100} { Changing that to if {$state(http) == "" || [string is list $state(http)] && [lindex $state(http) 1] == 100} { would fix this error, although it might then miss the "100 Continue" status it was looking for. ---------------------------------------------------------------------- Comment By: Jeff Rogers (dvrsn) Date: 2013-01-04 10:55 Message: I initially encountered this problem with tcl 8.5/http 2.7.2, but it still occurs with tcl 8.6/http 2.8.4. ---------------------------------------------------------------------- Comment By: Donal K. Fellows (dkf) Date: 2013-01-03 17:49 Message: It would be more elegant to parse the first line properly according to the spec (version id <SPACE> code <SPACE> arbitrary string <EOL>) as that avoids other problems. Probably also ought to check that the version id is something we grok, to avoid the weird problems documented in another bug report (whose number I forget) where the server didn't bother to send back any HTTP headers at all... Which version of Tcl (or the http package) is this a bug report for? ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3599395&group_id=10894 |