I've run into an interesting bug in mp1. If I have a PerlCleanupHandler defined in a .htaccess file, then it won't run if there was a PerlInitHandler defined in httpd.conf. It doesn't matter what the PerlInitHandler does, as long as its there the cleanup fails. If I have the init handler run from within the .htaccess, its all fine, and it also works if I have a PerlLogHandler in .htaccess instead of a PerlCleanupHandler.
I'll attach two test files. Foo.pm is loading via PerlModule in httpd.conf, and I have |PerlInitHandler Foo->init|. I first noticed this with Apache::Reload, but any init handler will do it. With the init handler, I get lines in error_log for init, Request, and cleanup1. Without, I get lines for Request, cleanup1, and then the die. The cleanup1 handler was just for testing; removing it doesn't affect the results. I'm testing with RH9's perl 5.8.0, and cvs mod_perl/1.27_01-dev from about 12 hours ago, with a self compiled apache_1.3.27. This also happened with mp/1.27, but doesn't happen with mp2 (After I port my test modules to mp2). mod_perl is built as a .so with perl Makefile.PL USE_APXS=1 WITH_APXS=/usr/local/apache/bin/apxs EVERYTHING=1 Thanks, Bradley PS Is there a way to subscribe to this list so that I can post, but not receive any mails? I couldn't find a nomail option on the list page at perl.apache.org. I've subscribed to the digest version for now.
package Foo; use Apache; sub init($$) : method { warn "init"; return Apache::OK; } sub cleanup($$) : method { die "XXX"; return Apache::OK; } 1;
#!/usr/bin/perl -w use lib qw(.); use strict; use warnings; use Foo; sub cleanup1 { warn "cleanup1"; return Apache::OK; } Apache->request->register_cleanup(\&cleanup1); Apache->request->send_http_header('text/plain'); warn "Request"; print "HI!";
SetHandler perl-script PerlHandler Apache::Registry Options ExecCGI allow from all #PerlInitHandler Foo->init PerlCleanupHandler Foo->cleanup