Overview
| Artifact ID: | 51a60eadb4629e1fdff0624783ddb93f3a48d9b3 |
|---|---|
| Ticket: | 2b1eaecfae3aab675dab7837db3a6fea5bd7d484
http fails under certain circumstances |
| User & Date: | JKU on 2013-08-13 13:59:00 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed 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> - foundin changed to: "Tcl 8.6.0 http 2.8.5"
- is_private changed to: "0"
- login: "JKU"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "JKU"
- subsystem changed to: "29. http Package"
- title changed to: "http fails under certain circumstances"
- type changed to: "Bug"