On Sunday, January 5, 2003, at 09:39  AM, Joe Schaefer wrote:

John Heitmann <[EMAIL PROTECTED]> writes:

[...]

DirectoryIndex index.pl

DocumentRoot /tmp/web_directory

<Directory /tmp/web_directory>
     AddHandler perl-script .pl
     PerlHandler Apache::Registry
</Directory>
[...]

That httpd.conf combined with the code in the previous mail placed in
a file named "index.pl" and placed in /tmp/web_directory/ will exhibit
the problem nicely. I see nothing in the list archives or web site
about mod_dir or DirectoryIndex.
mod_dir does an internal redirect, which creates a new request_rec
struct and a new request_config.  I *think* the problem is that when
mod_perl runs its cleanup handler, it runs on the *original*
request_rec + request_config, which doesn't have the new pnotes.
So they never get cleaned up by mod_perl's per_request_cleanup().
Ah, great. Good hints! This is my first foray into Apache and mod_perl internals, but this patch appears to work. If this looks correct, I'll be happy to submit a regression test too if I can figure out how to do that.

I'll do this off of cvs next time, sorry about the nonstandard format.

diff mod_perl-1.27/src/modules/perl/mod_perl.c mod_perl.c
1113a1114,1123
> # Clear out any sub requests that may have occurred too.
> if (r->next) {
> perl_request_config* sub_cfg = (perl_request_config*)get_module_config(r->next->request_config, &perl_module);
> if (sub_cfg->pnotes) {
> hv_clear(sub_cfg->pnotes);
> SvREFCNT_dec(sub_cfg->pnotes);
> sub_cfg->pnotes = Nullhv;
> }
> }
>


This fixes the problem I described, but I still have other pnotes mem sticking around (I suspect). More on that as I can figure it out.

Thanks,

John


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to