In all my code i never used args in the filters, i always define filter
as proc filter { args} so for me it does not matter the order of the
arguments. Logically, WHY should be the first arg.
Zoran Vasiljevic wrote:
Hi!
I believe you guys are more familiar with this stuff
as I am. Can you please comment?
Gustaf Neumann (XOTcl) is trying to get OACS to work
with our code and has some remarks. I'm forwarding the
relevant portion of an email sent to me today.
i made some changes to oacs such it works with naviserver. The biggest
problem was the changed argument passing conventions for filters. i am
not sure, that the agument passing conventions of naviserver are the
best
possible choice, since
ns_register_filter trace GET * myfilter
calls now "myfilter {} WHY"
instead of "myfilter WHY" as it was before. It should not be
necessary to pass a nonexisting argument around. I would finde
it more logically to have this as
"myfilter WHY"
or, when arguments are passed as
"myfilter WHY arg1 arg2 ...."
Since on has to alter the filter procs anyhow when moving from
aolserver,
this would not have beed a bad choice. With xotcl, i use e.g.
an object handling the filter requests, such as
Object create filter
filter proc preauth ....
filter proc postauth ...
filter proc trace ....
this worked nicely with the aolserver argument passing. now i have to
use
the strange looking method, that removes the empty first arg...
filter proc {} args {my eval $args}
Did you have some discussions about this? Is it to late to change this?
In order to use oacs with naviserver, i had to introduce the following
not very beautifiul mapping rules to keep the changes minimal and
keep the server working for aolserver and naviserver.
all the best
-gustaf
if {[ns_info name] eq "NaviServer"} {
foreach filter {rp_filter rp_resources_filter request_denied_filter} {
rename $filter ${filter}_aolserver
proc $filter {_ why} [list ${filter}_aolserver \$why]
}
rename rp_invoke_filter rp_invoke_filter_conn
proc rp_invoke_filter { filter_info why } { rp_invoke_filter_conn
{} $filter_info $why }
rename rp_invoke_proc rp_invoke_proc_conn
proc rp_invoke_proc { argv } { rp_invoke_proc_conn {}
$argv }
rename rp_handler rp_handler_aolserver
proc rp_handler {_} {rp_handler_aolserver}
}
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
naviserver-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/naviserver-devel
--
Vlad Seryakov
571 262-8608 office
[EMAIL PROTECTED]
http://www.crystalballinc.com/vlad/