Overview
| Artifact ID: | ff23ffaa714ea0d2faeaff230217460306c30830 |
|---|---|
| Ticket: | 74bc0e44f5ec534d3c77fc8d78fd4cd08d3f9a0d
Documentation of http::unregister misses return value |
| User & Date: | patthoyts on 2016-09-24 12:23:04 |
Changes
- 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"