From: SourceForge.net <no...@so...> - 2011-01-27 13:27:31
|
Bugs item #3165982, was opened at 2011-01-26 15:51 Message generated for change (Settings changed) made by patthoyts You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3165982&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: current: 8.5.9 >Status: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Azazel (a3a3el) Assigned to: Pat Thoyts (patthoyts) Summary: http 2.7 dependency on zlib breaks in Tcl 8.5 Initial Comment: 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. ---------------------------------------------------------------------- >Comment By: Pat Thoyts (patthoyts) Date: 2011-01-27 13:27 Message: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=110894&aid=3165982&group_id=10894 |