Skip to content
Tcl Source Code History Of Ticket 6a71dbe6ec
Login

History Of Ticket 6a71dbe6ec

Artifacts Associated With Ticket 6a71dbe6ec

  1. Ticket change [4e2f61f9d9] (rid 141728) by oehhar on 2015-05-12 15:58:18:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized to:
      As found out by Luc Monier on clt [https://groups.google.com/forum/#!topic/comp.lang.tcl/B6afDJQg8LA], the following http request fails 8.6 and succeeded on 8.5:
      <verbatim>
      % package require http
      2.8.8
      % set organism_name "nipah"
      nipah
      % set xml "
      <?xml version=\"1.0\" encoding=\"UTF-8\"?>
      <orgPdbQuery>
       <version>B0905</version>
       <queryType>org.pdb.query.simple.OrganismQuery</queryType>
       <description>Organism Search : Organism Name=$organism_name </description>
       <organismName>$organism_name</organismName>
      </orgPdbQuery>
      "
      
      % set url "http://www.rcsb.org/pdb/rest/search" 
      
      % ::http::config -urlencoding utf-8
      
      % set tok [::http::geturl $url -query $xml -type "application/x-www-form-urlencoded"]
      can't read "coding": no such variable
      </verbatim>
      
      The following patch is a first step to bring up the real error message:
      
      <verbatim>
      --- http-2.8.8.tm
      +++ http-2.8.9.tm
      @@ -11,7 +11,7 @@
       package require Tcl 8.6
       # Keep this in sync with pkgIndex.tcl and with the install directories in
       # Makefiles
      -package provide http 2.8.8
      +package provide http 2.8.9
       
       namespace eval http {
           # Allow resourcing to not clobber existing data
      @@ -1299,7 +1299,7 @@
       		set state(body) [zlib $coding $state(body)]
       	    }
       	} err]} {
      -	    Log "error doing $coding '$state(body)'"
      +	    Log "error doing coding '$state(body)' : $err"
       	    return [Finish $token $err]
       	}
      </verbatim>
      
      If this patch is applied, the output is as follows:
      
      <verbatim>
      ... init as above
      % proc http::Log args {puts **$args}
      
      % set tok [::http::geturl $url -query $xml -type "application/x-www-form-urlencoded"]
      **{Using sock02E7DC30 for www.rcsb.org:80} {}
      **{error doing coding '1WP7
      2VSM
      2VWD
      3D11
      3D12
      3N27
      4CO6
      4GJW
      4N5B
      ' : unsupported content-encoding "text/plain"}
      **{Closing socket sock02E7DC30 (no connection info)}
      </verbatim>
      
      Ok, "text/plain" missing in coding tables.
      Thus patch:
      <verbatim>
      @@ -1473,6 +1473,7 @@
       		gzip - x-gzip { lappend r gunzip }
       		compress - x-compress { lappend r decompress }
       		identity {}
      +		text/plain {}
       		default {
       		    return -code error "unsupported content-encoding \"$coding\""
       		}
      </verbatim>
      
      This gives the desired result:
      <verbatim>
      ... init as above
      % proc http::Log args {puts **$args}
      % set tok [::http::geturl $url -query $xml -type "application/x-www-form-urlencoded"]
      **{Using sock02E63980 for www.rcsb.org:80} {}
      **{Closing socket sock02E63980 (no connection info)}
      ::http::3
      % set rep [::http::data $tok]
      1WP7
      2VSM
      2VWD
      3D11
      3D12
      3N27
      4CO6
      4GJW
      4N5B
      
      </verbatim>
      
      I am not sure what I am doing.
      The patch just looks reasonable for the case.
      
      Thank you,
      Harald
      
    5. foundin initialized to: "8.6.4"
    6. is_private initialized to: "0"
    7. login: "oehhar"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "oehhar"
    14. subsystem initialized to: "29. http Package"
    15. title initialized to: "http encoding error not braught up"
    16. type initialized to: "Bug"
  2. Ticket change [d91293ad47] (rid 141731) by aku on 2015-05-12 17:07:40:

    1. login: "aku"
    2. mimetype: "text/plain"
    3. title changed to: "http encoding error not brought up"
  3. Ticket change [ecd8617e78] (rid 141739) by dgp on 2015-05-13 23:34:10:

    1. icomment:
      
      Good catch on the programming error in the [Log].
      
      For the actual error, I'm far from an HTTP expert, but
      is text/plain really the name of a valid ContentEncoding
      value?
      
      I thought that was a ContentType ?
      
      Are we adding to the list of ways this service is broken?
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  4. Ticket change [4737f8a3dc] (rid 141740) by dkf on 2015-05-13 23:42:23:

    1. icomment:
      That's a very broken webservice. But maybe we should improve our error handling.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  5. Ticket change [81875d1568] (rid 141751) by dkf on 2015-05-14 08:26:12:

    1. icomment:
      I've fixed the error handling. It now produces the (correct) error message:
      <pre>
      unsupported content-encoding "text/plain"
      </pre>
      I don't plan to "fix" that. Sometimes things are just really badly broken and need to be called out as such.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
    6. username: "dkf"
  6. Ticket change [8f7c30bd06] (rid 141752) by dkf on 2015-05-14 08:27:50:

    1. icomment:
      I've also stopped it showing the body there; if that's containing compressed data, there's really no way that's going to display properly anywhere.
      
    2. login: "dkf"
    3. mimetype: "text/html"
    4. username: "dkf"
  7. Ticket change [cfa2e33a3f] (rid 163102) by oehhar on 2018-05-15 21:04:40:

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