Skip to content
Tcl Source Code History Of Ticket 9172a66e4078f9a7
Login

History Of Ticket 9172a66e4078f9a7

Artifacts Associated With Ticket 9172a66e4078f9a7

  1. Ticket change [be70200b82] (rid 142855) by pchai26 on 2015-08-18 14:48:31:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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?
      
    5. foundin initialized to: "Tcl 8.5+"
    6. is_private initialized to: "0"
    7. login: "pchai26"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "a7b47e3e6a613ceeaf221568b866140e112f4810"
    10. resolution initialized to: "None"
    11. severity initialized to: "Critical"
    12. status initialized to: "Open"
    13. submitter initialized to: "pchai26"
    14. subsystem initialized to: "29. http Package"
    15. title initialized to: "Possible issue with http 2.7+"
    16. type initialized to: "Bug"
  2. Ticket change [1263932b54] (rid 142856) by oehhar on 2015-08-18 14:58:03:

    1. 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.
      
    2. login: "oehhar"
    3. mimetype: "text/plain"
    4. username: "oehhar"
  3. Ticket change [b721650e2e] (rid 142857) by ferrieux on 2015-08-18 15:20:51:

    1. 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]
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
  4. Ticket change [ec60adf70f] (rid 142901) by dgp on 2015-08-26 18:38:49:

    1. foundin changed to: "2.7+"
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. title changed to:
      HTTP 1.1 chunk support incompatible with -channel option
      
  5. Ticket change [38a39577d9] (rid 143035) by dkf on 2015-09-06 13:07:54:

    1. login: "dkf"
    2. mimetype: "text/plain"
    3. priority changed to: "7 High"
  6. Ticket change [03b51f7c81] (rid 200565) by kjnash on 2022-05-11 03:06:09:

    1. closedate changed to: "2459710.62927615"
    2. closer changed to: "kjnash"
    3. 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.
      
    4. login: "kjnash"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"