Skip to content
Tcl Source Code History Of Ticket 2b1eaecfae
Login

History Of Ticket 2b1eaecfae

Artifacts Associated With Ticket 2b1eaecfae

  1. Ticket change [51a60eadb4] (rid 133266) by JKU on 2013-08-13 13:59:00:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      The http library may call http::Eof twice under certain circumstances, which leads to a "data error" on the second try to remove the encoding.
      
      <verbatim>
      % package require http
      2.8.5
      % proc putargs args {puts $args}
      % trace add execution ::http::Eof enter putargs
      % http::geturl http://johannes13.de:36895/hgolf.tcl
      {Eof ::http::44} enter
      {Eof ::http::44} enter
      data error
      </verbatim>
      
      One possible way is if the server
      
        *  sends the header "Connection: keep-alive"
        *  sends the header "Content-Encoding: gzip"
        *  closes the connection after the request.
      
      Example webserver (I wrote it for code-golf and modified it a bit to match the requirements above):
      
      <verbatim>
      socket -server a 36895
      proc a s\ args {
      set h 200\ OK;set c "\nConnection: keep-alive\nContent-Encoding: gzip\nContent-Type: ";set g 0
      expr {[regexp {GET (\S*)} [gets $s] - 1]?[file isd [set f /home/$1]]?0:[file exi $f]?[set g 1;file ext $f]in{.txt .html}?[append h $c[dict get {.txt text/plain .html text/html} [file ext $f]]]:[append h ${c}application/octet-stream]:[set h 404\ Not\ Found]:[set h 405\ Not\ Supported]}
      puts $s HTTP/1.1\ $h
      if $g {flush $s;  set h [open $f];set cnt [zlib gzip [read $h]];
      puts $s "Content-Length: [string le $cnt]\n"
      flush $s
      fconfigure $s -translation binary;
      puts -nonewline $s $cnt
      close $h}
      close $s}
      </verbatim>
      
    5. foundin initialized to: "Tcl 8.6.0 http 2.8.5"
    6. is_private initialized to: "0"
    7. login: "JKU"
    8. priority initialized to: "5 Medium"
    9. resolution initialized to: "None"
    10. severity initialized to: "Minor"
    11. status initialized to: "Open"
    12. submitter initialized to: "JKU"
    13. subsystem initialized to: "29. http Package"
    14. title initialized to: "http fails under certain circumstances"
    15. type initialized to: "Bug"
  2. Ticket change [2f6858f1f5] (rid 162356) by kjnash on 2018-04-13 14:03:07:

    1. closedate changed to: "2458222.08550521"
    2. closer changed to: "kjnash"
    3. icomment:
      I have verified that this was a bug in http 2.7.10.  The attempt to decode content-encoding twice no longer occurs in 2.8.12, and was probably fixed long before that.  I'm going to close the bug.
      
    4. login: "kjnash"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"