Tclhttpd: why not return the HTTP status from Direct_Url?
- From: EL <eckhardnospam@xxxxxx>
- Date: Sun, 30 Mar 2008 23:04:40 +0200
Hi all,
I just had a look at the Direct_Url command in tclhttpd, which installs all procedures in a namespace as URL's, e.g.
Direct_Url /hello ::hello::
proc ::hello::/world {args} {
...
return "<b>hello world</b>"
}
Is there any particular reason to not return the HTTP code from Direct_Url's, so that e.g. one can define ::hello::/world like this:
proc ::hello::/world {args} {
...
return -code 400 "<i>wrong # args, should be ...</i>"
}
??
Looking at the code in lib/direct.tcl, this would just require some minor changes to the procedure DirectRespond: capture the code and give it as argument to Httpd_ReturnData. Currently every code except ok and 302 leads to an error.
However, I don't know all the side effects this would have besides returning the HTTP status... Any ideas?
TIA
Eckhard
.
- Follow-Ups:
- Prev by Date: Re: Speedup canvas itemconfigure -fill for many polygons.
- Next by Date: Re: where is expand {@}?
- Previous by thread: finding tk version in Matrix 10.6
- Next by thread: Re: Tclhttpd: why not return the HTTP status from Direct_Url?
- Index(es):