Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: f1ca91b4906e9e94a44f16a9de15f8e74998b889
Ticket: 1928131fffffffffffffffffffffffffffffffff
chunked headers leak in data when -handler used
User & Date: hassold on 2008-03-28 17:07:57
Changes

  1. assignee changed to: "hobbs"
  2. cmimetype changed to: "text/plain"
  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. foundin changed to: "obsolete: 8.5.2"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "hassold"
  10. subsystem changed to: "29. http Package"
  11. title changed to: "chunked headers link in data when -handler used"
  12. type changed to: "Bug"