Artifacts Associated With Ticket 74bc0e44f5
Ticket change [7044dd120f] (rid 148845) by oehhar on 2016-09-22 14:02:40:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
<h1>Documentation of return value of http::unregister missing</h1> The command 'http::unregister' returns a list of Port and Command used in a former 'http::register'. This is not documented. <h1>Documentation missing: error raised if http::unregister is called without registration</h1> The command 'http::unregister' raises an error, if the protocol was not registered. This is not documented. <h1>Use case </h1> I was looking for a possibility to find out, if a 'http::register https <cmd>' was already called. This is possible with the upper information: <verbatim> if {[catch { http::unregister https } lPortCmd]} { # not registered -> register on my own } else { # Ok, was registered - reregister http::register https {*}$lPortCmd } </verbatim> I want to use this code in tclws to preserve an already registered handler. Thank you, Harald - foundin initialized to: "8.6.6"
- is_private initialized to: "0"
- login: "oehhar"
- priority initialized to: "5 Medium"
- private_contact initialized to: "0f366eb3e9e2fcab52b8ebacd197db9047186a5f"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "oehhar"
- subsystem initialized to: "29. http Package"
- title initialized to:
Documentation of http::unregister misses return value
- type initialized to: "Bug"
Ticket change [8c314ba2c6] (rid 148846) by patthoyts on 2016-09-22 15:14:53:
- icomment:
It would be better to use <verbatim> if {![info exists ::http::urlTypes(https)]} { ... } </verbatim> I this is deemed useful on the http package api then 'http::register https' could be usefully modified to return the registration information or an empty list. That would be in keeping with [set] and so on. - login: "patthoyts"
- mimetype: "text/html"
- username: "patthoyts"
- icomment:
Ticket change [b7e7da5316] (rid 148847) by oehhar on 2016-09-22 15:52:07:
- icomment:
Pat, thanks for the message. IMHO https and the underlaying package (tls/Twapi) and its options (tls package) are quite critical. Thus packages which require registered https protocol should not delete a present registration, but just use it or post an error if not compatible. To your solution: I don't like to access internals ('::http::urlTypes(https)') if they don't belong to the public interface. Tomorow, a maintainer changes the array to a dict and it does not work any more. To your proposal, I would prefer a solution where we can explicitly query the current setting. The 'set'-semantics does not help, as it returns the value just set, not the value eventually replaced by the set. Thank you, Harald - login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [ff23ffaa71] (rid 148850) by patthoyts on 2016-09-24 12:23:04:
- icomment:
What I was suggesting is that this can be exposed onto the published API for use as in this example:<br/> <verbatim> % package require http 2.8.9 % http::register https 443 tls::socket 443 tls::socket % http::register https 443 tls::socket % http::register beep % </verbatim> Extending the <tt>http::register</tt> command to accept either a single parameter to query the set of registered protocols, or to take 3 parameters for registering a new protocol. This is in keeping with the style of many Tcl and Tk commands of which 'set' is one example. Tk widgets 'configure' commands are another, or the channel 'fconfigure' command. The changes required are pretty simple. The following should be enough. <verbatim>proc http::register {args} { variable urlTypes if {[llength $args] == 1} { set proto [lindex $args 0] if {[info exists urlTypes($proto)]} { return $urlTypes($proto) } else { return {} } } elseif {[llength $args] == 3} { lassign $args proto port command set urlTypes([string tolower $proto]) [list $port $command] } else { return -code error \ "wrong # args: should be http::register proto ?port command?" } } </verbatim> It might also be useful to make it return all the registered protocol names by passing in no parameters. - login: "patthoyts"
- mimetype: "text/html"
- username: "patthoyts"
- icomment:
Ticket change [cb279314e7] (rid 148851) by oehhar on 2016-09-24 15:12:32:
- icomment:
Hi Pat, yes, that is a good idea. Nevertheless, it would require a tip, while accepting this ticket is a bug fix, much cheaper. So I will try to go this way. Thank you, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
- icomment:
Ticket change [a650ab3532] (rid 149108) by dkf on 2016-10-08 17:01:05:
- assignee changed to: "dkf"
- login: "dkf"
- mimetype: "text/plain"
Ticket change [740965b03e] (rid 149109) by dkf on 2016-10-08 17:08:07:
- icomment:
Documenting properly an existing behaviour that is actually documented in the http.tcl file is not a change in any meaningful way; we can Just Do It. Reconsiderations of the API require opening a can of worms.
- login: "dkf"
- mimetype: "text/x-fossil-wiki"
- username: "dkf"
- icomment:
Ticket change [bb81e544d9] (rid 149116) by dkf on 2016-10-08 17:11:04:
- closedate changed to: "2457670.2160191"
- closer changed to: "dkf"
- login: "dkf"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [6d5c903e28] (rid 149152) by oehhar on 2016-10-11 13:22:52:
- closedate changed to: "2457673.057553"
- closer changed to: "oehhar"
- icomment:
Thank you documenting the return value by commit [6bae8fa2fdb517a7]. I would also appreciate to document, that an error is rised if there is no registration. Thanks, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"
Ticket change [0e1e5cc2a1] (rid 149195) by dkf on 2016-10-12 09:58:43:
- closedate changed to: "2457673.91577549"
- closer changed to: "dkf"
- icomment: "A fair point. Updated."
- login: "dkf"
- mimetype: "text/x-fossil-wiki"
- username: "dkf"
Ticket change [43ba6d4e58] (rid 149196) by oehhar on 2016-10-12 12:53:07:
- closedate changed to: "2457674.03689341"
- closer changed to: "oehhar"
- icomment:
Thank you for commit [238be90a8b] ! No more moaning ;-) Thanks, Harald
- login: "oehhar"
- mimetype: "text/x-fossil-wiki"
- username: "oehhar"