On 7/12/05, Bernd Eidenschink <[EMAIL PROTECTED]> wrote:
>
> Hi Stephen,
>
> I just read your commits. Can you please explain the effects of your work to
> me for this:
> >Fix the confusion around the default adp
> >request handler and ns_register_adp and add the missing proc
> >callback info. ns_info requestprocs now gets things
> >right.
>
> and that:
> >ns_register_adp will also now register the default adp
> >request handler if you don't specify an optional file to map.
>
> What does this exactly mean?
If you haven't updated yet, login to a command shell (make runtest) and:
% join [ns_info requestprocs] \n
You'll see that the ADP request handlers are not named. That's weird
since I remember adding the names to nsd/proc.c myself... What I
actually named was the ADP request handler that gets registered when
you call ns_register_adp, which is subtly different.
ns_register_adp GET /aurl /home/stephen/my.adp
What happens here is that /aurl, /aurl/foo, etc. all end up running
my.adp. I modified this function to make the adpfile optional. Now
you can call:
ns_register_adp GET /adps
and normal adp processing will happen for that directory. You might
want to do this if you register a default handler for the root URL,
but want ADPs in a sub directory. So here's how it looks now:
% ns_register_proc GET /foo/* foo_handler arg
% ns_register_adp GET /foo/adp/*
% ns_register_adp GET /foo/x.adp /var/x.adp
% join [ns_info requestprocs] \n
test GET * ns:fastget test
test HEAD * ns:fastget test
test POST * ns:fastget test
test GET *.adp ns:adprequest test
test HEAD *.adp ns:adprequest test
test POST *.adp ns:adprequest test
test GET *.tcl ns:tclrequest ns_sourceproc {}
test HEAD *.tcl ns:tclrequest ns_sourceproc {}
test POST *.tcl ns:tclrequest ns_sourceproc {}
test GET /foo* ns:tclrequest foo_handler arg
test GET /foo/adp* ns:adprequest test
test GET /foo/x.adp* ns:adpmap /var/x.adp