Skip to content
Tcl Source Code History Of Ticket c11a51c482
Login

History Of Ticket c11a51c482

Artifacts Associated With Ticket c11a51c482

  1. Ticket change [8179f124fb] (rid 138585) by dkf on 2014-07-06 17:13:33:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/html"
    4. comment initialized to:
      If you're using the http package to do REST with content type negotiation, you need to configure the package's <tt>Accept:</tt> types mechanism from time to time. This is a bit of a broken API, in that there's no option to override from options passed to <tt>http::geturl</tt>. This is not the feature change I'm requesting.
      <p>
      <i>However,</i> if you're also using asynchronous connecting then you've got an additional problem in that the configuration of the <tt>-accept</tt> option is only read when the connection is made; two connections that require different <tt>Accept:</tt> headers will have a race condition between the two, and so which is used will be pretty much random. <b>This Is Wrong.</b> This is the bug I'm reporting.
      <p>
      Suggested fix, <i>without fixing the original API botch,</i> is to take a copy of <tt>$http(-accept)</tt> into the <tt>state</tt> array during <tt>http::geturl</tt> so that the value used in <tt>http::Connected</tt> is predictable.
      <p>
      See also: <a href="http://www.kroc.tk/forum/index.php?t=msg&th=1041&goto=5213&#msg_5213">this thread</a> with the comment that prompted me to look into the potential feature request, and discover the race:
      <blockquote><tt><i>Ok well the final solution was that using -headers in the http::geturl doesn't seem to work when setting an "Accept" header - which kind of sucks…</i></tt></blockquote>
      
    5. foundin initialized to: "http 2.8.8"
    6. is_private initialized to: "0"
    7. login: "dkf"
    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: "dkf"
    13. subsystem initialized to: "29. http Package"
    14. title initialized to: "Configuration race condition in accept types"
    15. type initialized to: "Bug"
  2. Ticket change [c29a1d87b6] (rid 141850) by dkf on 2015-05-18 07:53:54:

    1. closedate changed to: "2457160.8291084"
    2. closer changed to: "dkf"
    3. icomment:
      Both kinds of fixes applied. The value of the <tt>-accept</tt> option is now saved during <code>http::geturl</code>, and the existing <tt>-headers</tt> can now override it.
      
    4. login: "dkf"
    5. mimetype: "text/html"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"