Artifacts Associated With Ticket 9172a66e4078f9a7
Ticket change [be70200b82] (rid 142855) by pchai26 on 2015-08-18 14:48:31:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Hello Tcl Core Team, I am having an issue with http 2.7+, with Tcl 8.5+. First, if you put this url string in browser (Chrome, firefox, IE, etc,): “http://skyview.gsfc.nasa.gov/cgi-bin/pskcall?VCOORD=ETA%20Carinae&SURVEY=DSS&SCOORD=Equatorial&SFACTR=Default&PIXELX=300&PIXELY=300” It will produce a data file (astronomical data file.) The data file is correct and being our test benchmark. But if you tried these commands under TCLSH: package require http set skyviewout [open “test.fits” w] set token [::http:: geturl “http://skyview.gsfc.nasa.gov/cgi-bin/pskcall” -channel $skyviewout -query “VCOORD=ETA%20Carinae&SURVEY=DSS&SCOORD=Equatorial&SFACTR=Default&PIXELX=300&PIXELY=300”] close $skyviewout It then produces a corrupted data file that has some undeciphiable strings at beginning of the data file, a line consists of “400^M" and maybe somewhere else in the data file (like break line with “5000^M”) too. These TCLSH commands used to work fine. Just as soon as we upgrade to http package 2.7+, it suddenly produced strange results, and it is making reading those astronomical data files impossible. Can you help?
- foundin initialized to: "Tcl 8.5+"
- is_private initialized to: "0"
- login: "pchai26"
- priority initialized to: "5 Medium"
- private_contact initialized to: "a7b47e3e6a613ceeaf221568b866140e112f4810"
- resolution initialized to: "None"
- severity initialized to: "Critical"
- status initialized to: "Open"
- submitter initialized to: "pchai26"
- subsystem initialized to: "29. http Package"
- title initialized to: "Possible issue with http 2.7+"
- type initialized to: "Bug"
Ticket change [1263932b54] (rid 142856) by oehhar on 2015-08-18 14:58:03:
- icomment:
Peter S commented: I tested your command with http 2.7.13, and I experience the same. However, if I use [set data [http::data $token]] and save it to a file instead of using the -channel parameter, then the data seems correct. So that may be a (temporary) workaround.
- login: "oehhar"
- mimetype: "text/plain"
- username: "oehhar"
- icomment:
Ticket change [b721650e2e] (rid 142857) by ferrieux on 2015-08-18 15:20:51:
- icomment:
The issue is that when upgrading, the Tcl HTTP client selected protocol version 1.1, which allowed the server to use chunked encoding transfer. Those 400^M and 5000^M are chunk length prefixes. Unfortunately, the chunk support in the HTTP package does not extend to "-channel" mode; in this case the channel receives the chunked-encoded flow unmodified. As a workaround, avoid the -channel option; sure, the body will flow into RAM instead, but will be correctly 'de-chunked': % set token [::http::geturl {http://skyview.gsfc.nasa.gov/cgi-bin/pskcall?VCOORD=ETA%20Carinae&SURVEY=DSS&SCOORD=Equatorial&SFACTR=Default&PIXELX=300&PIXELY=300}] ::http::1 % set x [http::data ::http::1];set y [string length $x] 374400 % string range $x 0 20 SIMPLE = % (note also above that I didn't use -query, meaning a POST, since your primary example in a browser is a GET) Also note that when saving to a binary file you might want to [fconfigure -translation binary] to avoid unwanted translations. Wrapping it up: package require http set token [::http::geturl {http://skyview.gsfc.nasa.gov/cgi-bin/pskcall?VCOORD=ETA%20Carinae&SURVEY=DSS&SCOORD=Equatorial&SFACTR=Default&PIXELX=300&PIXELY=300}] set skyviewout [open “test.fits” w] fconfigure $skyviewout -translation binary puts -nonewline $skyviewout [http::data $token] - login: "ferrieux"
- mimetype: "text/plain"
- icomment:
Ticket change [ec60adf70f] (rid 142901) by dgp on 2015-08-26 18:38:49:
- foundin changed to: "2.7+"
- login: "dgp"
- mimetype: "text/plain"
- title changed to:
HTTP 1.1 chunk support incompatible with -channel option
Ticket change [38a39577d9] (rid 143035) by dkf on 2015-09-06 13:07:54:
- login: "dkf"
- mimetype: "text/plain"
- priority changed to: "7 High"
Ticket change [03b51f7c81] (rid 200565) by kjnash on 2022-05-11 03:06:09:
- closedate changed to: "2459710.62927615"
- closer changed to: "kjnash"
- icomment:
The response from this URL is now a redirect to the corresponding https URL: https://skyview.gsfc.nasa.gov/cgi-bin/pskcall?VCOORD=ETA%20Carinae&SURVEY=DSS&SCOORD=Equatorial&SFACTR=Default&PIXELX=300&PIXELY=300 Using the second URL, the transfer is indeed chunked: the response headers include "Transfer-Encoding chunked". The file is now the same when downloaded by http::geturl 2.10a1 as when downloaded by a web browser, with the exception of two datestamps and an internal filename. This bug with chunked encoding was fixed years ago. I have closed the ticket.
- login: "kjnash"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"