ClearModuleList/AddModule are not DSO specific - they just shuffle around
the order of the internal module list, which is what apache dispatches
against at request time. note that both of these are provide by core, while
LoadModule is provided by mod_so.
Does that apply to Apache 1.3 as well as 2.0?
unfortunately not. I'm working on the ability to shuffle module around like
that, but I can't get it to work on win32.
Ah, okay, so just to be clear, with Apache 2, I can do this:
ClearModuleList AddModule mod_dir AddModule mod_perl
And mod_dir will do its thing before things get passed on to any mod_perl handlers. Is that right?
but directories are really something different. in mp2 it looks like we'll
need to take the approach that mod_dir does in 2.0 - if you want your
PerlResponseHandler to be triggered for directories you'll specifically need
to set $r->handler('perl-script') in a fixup handler.
Really?! How come?
What is DIR_MAGIC_TYPE?
the internal content type that Apache sets when it sees that the uri
resolves to a directory. I think it's http/unix-directory or something, but
you can check httpd.h for that.
Ah, okay, thanks!
sub handler { my $r = shift; return DECLINED unless -d $r->filename && $r->uri !~ m{/$};
yeah, you can probably just check for DIR_MAGIC_TYPE here.
Cool, saves the expense of the stat! Here's what I have now:
sub handler { my $r = shift; return DECLINED unless $r->content_type == DIR_MAGIC_TYPE && $r->uri !~ m{/$}; my $args = $r->args; $r->header_out(Location => $r->uri . '/' . ($args ? "?$args" : '')); return HTTP_MOVED_PERMANENTLY; }
Going back to your last message...
- use a fixup handler to override mod_perl settings. for example:
use Apache::Constants qw(DECLINED DIR_MAGIC_TYPE): $r->set_handlers(PerlHandler => sub { return DECLINED }) if $r->content_type = DIR_MAGIC_TYPE;
This assumes that I want to decline a request for a directory every time. But I don't; only if there is no "/" at the end. And that's effectively what I'm doing with my Apache::Dir module, no?
It looks like I could recommend that it be used as PerlFixupHandler, though, instead of a PerlHandler (in 1.3).
Thanks,
David
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]