Artifacts Associated With Ticket 3165982fffffffff
Ticket change [7d9c5ddf1a] (rid 97270) by a3a3el on 2011-01-26 15:51:26:
- assignee initialized to: "patthoyts"
- cmimetype initialized to: "text/plain"
- comment initialized to:
The http 2.7 package introduced in 8.5.2 has a dependency on the in-core zlib package which is only present in 8.6. Consequently, any gzip-encoded response is incorrectly handled. Here I use 8.5.1: $ cat <<END | /tmp/tcl8.5.1/bin/tclsh8.5 > puts "Tcl: [package present Tcl]" > package require http > puts "HTTP: [package present http]" > if { [ catch { > set tok [http::geturl http://centrebet.com/cust \ > -headers {Accept-Encoding gzip}] > } err] } { > puts \$err > } else { > puts \$tok > } > END Tcl: 8.5.1 HTTP: 2.5.3 ::http::1 which doesn't attempt the decompress the body, and http::geturl returns successfully. Here I use 8.5.2: $ cat <<END | /tmp/tcl8.5.2/bin/tclsh8.5 > puts "Tcl: [package present Tcl]" > package require http > puts "HTTP: [package present http]" > if { [ catch { > set tok [http::geturl http://centrebet.com/cust \ > -headers {Accept-Encoding gzip}] > } err] } { > puts \$err > } else { > puts \$tok > } > END Tcl: 8.5.2 HTTP: 2.7 invalid command name "zlib" which calls http::Gunzip to decompress and fails because zlib is not available. - foundin initialized to: "obsolete: 8.5.9"
- is_private initialized to: "0"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "a3a3el"
- subsystem initialized to: "29. http Package"
- title initialized to: "http 2.7 dependency on zlib breaks Tcl 8.5"
- type initialized to: "Bug"
Ticket change [292b6a8c83] (rid 88827) by a3a3el on 2011-01-26 23:00:56:
- title changed to: "http 2.7 dependency on zlib breaks in Tcl 8.5"
Ticket change [5f4bfe11c8] (rid 115794) by patthoyts on 2011-01-27 20:27:30:
- icomment:
This feature is to enable support of compressed streams when you have a supported zip extension. There is one built into tcl 8.6 but in 8.5 people can load one in and one is included in tclkit. If - and only if - a suitable extension package was loaded the http package will include the Accept-Encoding header to indicate that it can support compressed streams. You have deliberately set this header to indicate you will accept gzip compressed data. In this case you are responsible for decoding it. If you plan on using a different incompatible package to decompress the data then you can replace the Gunzip function with your own once you load the http package. Beware that the http package uses lazy loading so you should actually call the http::geturl function to force loading the procedures before you replace them.
- login: "patthoyts"
- mimetype: "text/plain"
- username: "patthoyts"
- icomment:
Ticket change [1cc6bbc0da] (rid 90674) by patthoyts on 2011-01-27 20:27:31:
- closedate changed to: "2011-01-27T13:27:31"
- closer changed to: "patthoyts"
- icomment:
allow_comments - 1
- login: "patthoyts"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Closed"
- username: "patthoyts"