Skip to content
Tcl Source Code History Of Ticket 1928131fffffffff
Login

History Of Ticket 1928131fffffffff

Artifacts Associated With Ticket 1928131fffffffff

  1. Ticket change [f1ca91b490] (rid 109417) by hassold on 2008-03-28 17:07:57:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Support for chunk transfer in http 2.7 introduces a serious incompatibility with respect to previous http package versions.
      
      When a -handler argument is defined, chunk processing is not done, so returned data has "<size>\n" chunk headers leaked in, together with a terminating "0\n" segment. It means any current code which calls geturl with a -handler argument (e.g. hv3, but also probably most code caring about reporting progress during non-blocking http transfer) will get corrupted answer. In new http.tcl:1029, one can find:
      
      if {[info exists state(-handler)]} {
       set n [eval $state(-handler) [list $sock $token]]
      } elseif {[info exists state(transfer_final)]} {
        ....
      } elseif {[info exists state(transfer)]
            && $state(transfer) eq "chunked"} {
        ....
      
      so, as long as state(-handler) exists, chunk processing is not performed. Also, while having a look at this new http implementation, I noticed that in the chunk handling code, socket is temporaly switched back to blocking mode when reading chunk length header
      
        fconfigure $sock -blocking 1
        set chunk [read $sock $size]
        fconfigure $sock -blocking $bl
      
      which seems to me quite hazardous, since this might freeze a whole application in Event callback one may assume to be non-blocking.
      
    4. foundin initialized to: "obsolete: 8.5.2"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "hassold"
    10. subsystem initialized to: "29. http Package"
    11. title initialized to: "chunked headers link in data when -handler used"
    12. type initialized to: "Bug"
  2. Ticket change [cf12fb9321] (rid 112901) by hassold on 2008-03-29 00:09:02:

    1. priority changed to: "7 High"
  3. Ticket change [6bec491deb] (rid 128411) by ferrieux on 2008-07-01 04:47:42:

    1. icomment:
      Logged In: YES 
      user_id=496139
      Originator: NO
      
      Just fixed typo in title.
      Will look at this, but no timing guarantees ;-)
      
      
    2. login: "ferrieux"
    3. mimetype: "text/plain"
    4. title changed to: "chunked headers leak in data when -handler used"
    5. username: "ferrieux"
  4. Ticket change [f9787af6ab] (rid 91715) by arjenmarkus on 2009-11-13 16:57:01:

    1. icomment:
      I  had a problem with http::geturl that seems related to chunked transfers:
      
      I ran into this issue with http and the -channel option, version 2.7.4, 
      running Windows XP. I wanted to retrieve zip files and did so with code like: 
      
      set outfile [open myzipfile.zip w] 
      fconfigure $outfile -translation binary 
      ::http::geturl $URL -channel $outfile 
      close $outfile 
      
      This led to corrupted zip files that could not be read by the zip::vfs package. 
      The corruption was limited:
      - A line with a number (609) appeared at the start (ended with carriage-return line-feed)
      - The actual contents of the zip-file I wanted
      - A line with a number (0) and two newlines
      
      Using code like: 
      
      set token [::http::geturl $URL] 
      set outfile [open myzipfile.zip w] 
      fconfigure $outfile -translation binary 
      puts -nonewline $outfile [::http::data $token] 
      close $outfile 
      
      gave me the zip files I wanted. 
      
      According to Pat Thoyts this has to do with chunked data transfers.
      
      
    2. login: "arjenmarkus"
    3. mimetype: "text/plain"
    4. username: "arjenmarkus"
  5. Ticket change [214c60907e] (rid 200564) by kjnash on 2022-05-11 02:20:29:

    1. assignee changed to: "aku"
    2. closer changed to: "nobody"
    3. comment changed to:
      Support for chunk transfer in http 2.7 introduces a serious incompatibility with respect to previous http package versions.
      
      When a -handler argument is defined, chunk processing is not done, so returned data has "<size>\n" chunk headers leaked in, together with a terminating "0\n" segment. It means any current code which calls geturl with a -handler argument (e.g. hv3, but also probably most code caring about reporting progress during non-blocking http transfer) will get corrupted answer. In new http.tcl:1029, one can find:
      
      if {[info exists state(-handler)]} {
       set n [eval $state(-handler) [list $sock $token]]
      } elseif {[info exists state(transfer_final)]} {
        ....
      } elseif {[info exists state(transfer)]
            && $state(transfer) eq "chunked"} {
        ....
      
      so, as long as state(-handler) exists, chunk processing is not performed. Also, while having a look at this new http implementation, I noticed that in the chunk handling code, socket is temporaly switched back to blocking mode when reading chunk length header
      
        fconfigure $sock -blocking 1
        set chunk [read $sock $size]
        fconfigure $sock -blocking $bl
      
      which seems to me quite hazardous, since this might freeze a whole application in Event callback one may assume to be non-blocking.
      
    4. icomment:
      The http package "fixed" this bug years ago, by dropping to HTTP/1.0 if the -handler option is used.
      
      The -handler callback receives the response as the raw output from the server.  In HTTP/1.1 this is not useful (we would like instead to receive the content after de-chunking and decompression, in order to implement progressive rendering).
      
      These facts are noted in the man page http(n), so I suggest closing this bug.
      
    5. login: "kjnash"
    6. mimetype: "text/plain"
    7. severity changed to: "Minor"
  6. Ticket change [205bffb068] (rid 200617) by kjnash on 2022-05-13 03:04:02:

    1. login: "kjnash"
    2. mimetype: "text/plain"
    3. resolution changed to: "Fixed"
    4. status changed to: "Pending"
  7. Ticket change [9c7ad8461f] (rid 201361) by kjnash on 2022-05-30 16:26:37:

    1. closedate changed to: "2459730.18515738"
    2. closer changed to: "kjnash"
    3. login: "kjnash"
    4. mimetype: "text/plain"
    5. status changed to: "Closed"