Re: Apache::Registry RFE
On Tue, 30 May 2000, Michael Blakeley wrote: Of course there was an error... At 9:54 PM -0700 5/30/2000, Michael Blakeley wrote: $r-log_error($errsv) if $Apache::RegistryYA::AutoLog; s/RegistryYA/Registry I'm also having second thoughts about the binary nature of this thing... I'd forgotten that $errsv might well be a text message like: Can't locate object method foo via package "Apache" at... which I'd quite like to see in the log. So maybe... $ diff -w Registry.pm.orig Registry.pm 26a27,28 $Apache::Registry::AutoLog ||= 32768; 155c157,160 $r-log_error($errsv); --- { local $^W = 0; $r-log_error($errsv) if $Apache::Registry::AutoLog 0+$errsv } This way, setting $Apache::Registry::AutoLog = 300 gives me the behavior I want (no extra log lines for 302, 304, 500) while still letting "true" eval errors through. The default value should come pretty close to the original behavior. thanks for the patch, but we've stopped adding features to Apache::Registry. you can implement this with a subclass of Apache::RegistryNG, something like so: package My::Registry; use Apache::RegistryNG (); @ISA = qw(Apache::RegistryNG); sub log_error { my($r, $errsv) = @_; $r-SUPER::log_error($errsv) if $AutoLog 0+$errsv } 1; __END__ PerlHandler My::Registry
Re: Apache::Registry RFE
At 12:40 PM -0700 6/1/2000, Doug MacEachern wrote: On Tue, 30 May 2000, Michael Blakeley wrote: $ diff -w Registry.pm.orig Registry.pm 26a27,28 $Apache::Registry::AutoLog ||= 32768; 155c157,160 $r-log_error($errsv); --- { local $^W = 0; $r-log_error($errsv) if $Apache::Registry::AutoLog 0+$errsv } This way, setting $Apache::Registry::AutoLog = 300 gives me the behavior I want (no extra log lines for 302, 304, 500) while still letting "true" eval errors through. The default value should come pretty close to the original behavior. thanks for the patch, but we've stopped adding features to Apache::Registry. you can implement this with a subclass of Apache::RegistryNG, something like so: Thanks - but RegistryNG causes problems elsewhere in my code. Apache::File::mtime() doesn't seem to work with RegistryNG. The code: $mtime = 954291795; if (defined $mtime) { $r-update_mtime($mtime); warn "mtime=".join(',', $mtime, $r-mtime); $r-set_last_modified; } works fine in Apache::Registry, but seems to set mtime to 0 in Apache::RegistryNG. Since I can't seem to get a handle on this problem, I've gone back to Apache::Registry. Solaris 2.6 + patches, Apache 1.3.9, mod_perl 1.24, perl -V says Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration: Platform: osname=solaris, osvers=2.6, archname=sun4-solaris uname='sunos mail 5.6 generic_105181-17 sun4u sparc sunw,ultra-5_10 ' config_args='-des -Dcc=gcc -Dprefix=/usr/local -Doptimize=-g -O -Duseshrplib' hint=recommended, useposix=true, d_sigaction=define usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef useperlio=undef d_sfio=undef uselargefiles=define use64bitint=undef use64bitall=undef uselongdouble=undef usesocks=undef Compiler: cc='gcc', optimize='-g -O', gccversion=2.95.1 19990816 (release) cppflags='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include' ccflags ='-DDEBUGGING -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' stdchar='unsigned char', d_stdstdio=define, usevfork=false intsize=4, longsize=4, ptrsize=4, doublesize=8 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, usemymalloc=y, prototype=define Linker and Libraries: ld='gcc', ldflags =' -L/usr/local/lib ' libpth=/usr/local/lib /lib /usr/lib /usr/ccs/lib libs=-lsocket -lnsl -ldl -lm -lc -lcrypt -lsec libc=/lib/libc.so, so=so, useshrplib=true, libperl=libperl.so Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags=' -R /usr/local/lib/perl5/5.6.0/sun4-solaris/CORE' cccdlflags='-fPIC', lddlflags='-G -L/usr/local/lib' Characteristics of this binary (from libperl): Compile-time options: DEBUGGING USE_LARGE_FILES Built under solaris Compiled at Apr 2 2000 14:37:00 @INC: /usr/local/lib/perl5/5.6.0/sun4-solaris /usr/local/lib/perl5/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl . -- Mike
Re: Apache::Registry RFE
Thanks - but RegistryNG causes problems elsewhere in my code. Apache::File::mtime() doesn't seem to work with RegistryNG. The code: whoops!! Apache::PerlRun/RegistryNG were written before apache introduced the ap_update_mtime api function. i've renamed Apache::PerlRun's version to set_mtime, as it is not supposed to override Apache::update_mtime. Index: lib/Apache/PerlRun.pm === RCS file: /home/cvs/modperl/lib/Apache/PerlRun.pm,v retrieving revision 1.28 diff -u -r1.28 PerlRun.pm --- lib/Apache/PerlRun.pm 2000/05/12 07:10:57 1.28 +++ lib/Apache/PerlRun.pm 2000/06/01 21:05:12 @@ -104,7 +104,7 @@ $Apache::Registry-{$package}{'mtime'} = $mtime); } -sub update_mtime { +sub set_mtime { my($pr, $mtime, $package) = @_; $mtime ||= $pr-{'mtime'}; $package ||= $pr-{'namespace'}; Index: lib/Apache/RegistryNG.pm === RCS file: /home/cvs/modperl/lib/Apache/RegistryNG.pm,v retrieving revision 1.5 diff -u -r1.5 RegistryNG.pm --- lib/Apache/RegistryNG.pm1999/06/11 02:50:01 1.5 +++ lib/Apache/RegistryNG.pm2000/06/01 21:05:12 @@ -45,7 +45,7 @@ $pr-sub_wrap; my $rc = $pr-compile; return $rc if $rc != OK; - $pr-update_mtime; + $pr-set_mtime; } $rc = $pr-run(@_);
Re: Apache::Registry RFE
Of course there was an error... At 9:54 PM -0700 5/30/2000, Michael Blakeley wrote: $r-log_error($errsv) if $Apache::RegistryYA::AutoLog; s/RegistryYA/Registry I'm also having second thoughts about the binary nature of this thing... I'd forgotten that $errsv might well be a text message like: Can't locate object method foo via package "Apache" at... which I'd quite like to see in the log. So maybe... $ diff -w Registry.pm.orig Registry.pm 26a27,28 $Apache::Registry::AutoLog ||= 32768; 155c157,160 $r-log_error($errsv); --- { local $^W = 0; $r-log_error($errsv) if $Apache::Registry::AutoLog 0+$errsv } This way, setting $Apache::Registry::AutoLog = 300 gives me the behavior I want (no extra log lines for 302, 304, 500) while still letting "true" eval errors through. The default value should come pretty close to the original behavior. -- Mike