cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in
stas01/10/18 23:46:25 Modified:ModPerl-Registry/t/conf extra.conf.in Log: - prepare the configuration for a set of /same_interp aliases and registry configurations - some slight reorg of the conf file Revision ChangesPath 1.2 +73 -15modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in Index: extra.conf.in === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- extra.conf.in 2001/10/09 12:47:38 1.1 +++ extra.conf.in 2001/10/19 06:46:25 1.2 @@ -4,29 +4,31 @@ PerlSwitches -T PerlSwitches -Mlib=@ServerRoot@/../lib +PerlSwitches -Mlib=@ServerRoot@/../../Apache-Test/lib PerlSwitches -Mlib=@ServerRoot@/../../lib PerlSwitches -Mlib=@ServerRoot@/../../blib/lib PerlSwitches -Mlib=@ServerRoot@/../../blib/arch -Alias /registry/ @ServerRoot@/cgi-bin/ -Alias /registry_ng/ @ServerRoot@/cgi-bin/ -Alias /registry_bb/ @ServerRoot@/cgi-bin/ -Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/ -Alias /perlrun/ @ServerRoot@/cgi-bin/ - -#PerlModule TestDebugMy - -PerlSetVar ModPerl::RegistryCooker::DEBUG 0 - -### DEVMODE: Remove in production ### + DEVMODE: Remove in production ### PerlModule Apache::Reload PerlInitHandler Apache::Reload PerlSetVar ReloadAll Off PerlSetVar ReloadModules ModPerl::* +PerlSetVar ModPerl::RegistryCooker::DEBUG 2 + PerlModule ModPerl::RegistryCooker PerlModule ModPerl::Util +# +### Normal registry setup ### +# +Alias /registry/ @ServerRoot@/cgi-bin/ +Alias /registry_ng/ @ServerRoot@/cgi-bin/ +Alias /registry_bb/ @ServerRoot@/cgi-bin/ +Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/ +Alias /perlrun/ @ServerRoot@/cgi-bin/ + PerlModule ModPerl::RegistryNG Location /registry_ng PerlOptions +GlobalRequest @@ -45,6 +47,24 @@ PerlOptions +ParseHeaders /Location +PerlModule ModPerl::Registry +Location /registry + # PerlOptions +GlobalRequest +SetHandler perl-script +Options +ExecCGI +PerlResponseHandler ModPerl::Registry +PerlOptions +ParseHeaders +/Location + +# META: dumps core on OO handlers +Location /registry_oo_conf +PerlOptions +GlobalRequest +SetHandler perl-script +Options +ExecCGI +PerlResponseHandler ModPerl::Registry-handler +PerlOptions +ParseHeaders +/Location + PerlModule ModPerl::PerlRun Location /perlrun PerlOptions +GlobalRequest @@ -54,21 +74,59 @@ PerlOptions +ParseHeaders /Location -PerlModule ModPerl::Registry -Location /registry +### +### Same interpreter registry setup ### +### + +Alias /same_interp/registry/ @ServerRoot@/cgi-bin/ +Alias /same_interp/registry_ng/ @ServerRoot@/cgi-bin/ +Alias /same_interp/registry_bb/ @ServerRoot@/cgi-bin/ +Alias /same_interp/registry_oo_conf/ @ServerRoot@/cgi-bin/ +Alias /same_interp/perlrun/ @ServerRoot@/cgi-bin/ + +PerlModule Apache::TestHandler +Location /same_interp/registry_ng +PerlOptions +GlobalRequest +SetHandler perl-script +Options +ExecCGI +PerlFixupHandler Apache::TestHandler::same_interp_fixup +PerlResponseHandler ModPerl::RegistryNG +PerlOptions +ParseHeaders +/Location + +Location /same_interp/registry_bb PerlOptions +GlobalRequest SetHandler perl-script Options +ExecCGI +PerlFixupHandler Apache::TestHandler::same_interp_fixup +PerlResponseHandler ModPerl::RegistryBB +PerlOptions +ParseHeaders +/Location + +Location /same_interp/registry + # PerlOptions +GlobalRequest +SetHandler perl-script +Options +ExecCGI +PerlFixupHandler Apache::TestHandler::same_interp_fixup PerlResponseHandler ModPerl::Registry PerlOptions +ParseHeaders /Location -# META: dumps core on OO handlers -Location /registry_oo_conf +Location /same_interp/registry_oo_conf PerlOptions +GlobalRequest SetHandler perl-script Options +ExecCGI +PerlFixupHandler Apache::TestHandler::same_interp_fixup PerlResponseHandler ModPerl::Registry-handler +PerlOptions +ParseHeaders +/Location + +Location /same_interp/perlrun +PerlOptions +GlobalRequest +SetHandler perl-script +Options +ExecCGI +PerlFixupHandler Apache::TestHandler::same_interp_fixup +PerlResponseHandler ModPerl::PerlRun PerlOptions +ParseHeaders /Location
cvs commit: modperl-2.0/src/modules/perl modperl_handler.h modperl_perl_global.h modperl_types.h
dougm 01/10/19 09:40:45 Modified:src/modules/perl modperl_handler.h modperl_perl_global.h modperl_types.h Log: get rid of hpux warnings: Dangling comma not allowed by ANSI standard, ignored. Revision ChangesPath 1.8 +1 -1 modperl-2.0/src/modules/perl/modperl_handler.h Index: modperl_handler.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- modperl_handler.h 2001/04/19 17:57:15 1.7 +++ modperl_handler.h 2001/10/19 16:40:44 1.8 @@ -4,7 +4,7 @@ typedef enum { MP_HANDLER_ACTION_GET, MP_HANDLER_ACTION_PUSH, -MP_HANDLER_ACTION_SET, +MP_HANDLER_ACTION_SET } modperl_handler_action_e; #define modperl_handler_array_new(p) \ 1.10 +1 -1 modperl-2.0/src/modules/perl/modperl_perl_global.h Index: modperl_perl_global.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_perl_global.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- modperl_perl_global.h 2001/10/13 19:02:03 1.9 +++ modperl_perl_global.h 2001/10/19 16:40:44 1.10 @@ -9,7 +9,7 @@ } modperl_modglobal_key_t; typedef enum { -MP_MODGLOBAL_END, +MP_MODGLOBAL_END } modperl_modglobal_key_e; typedef struct { 1.52 +2 -2 modperl-2.0/src/modules/perl/modperl_types.h Index: modperl_types.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_types.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -r1.51 -r1.52 --- modperl_types.h 2001/09/28 19:51:40 1.51 +++ modperl_types.h 2001/10/19 16:40:44 1.52 @@ -107,7 +107,7 @@ MP_INTERP_SCOPE_HANDLER, MP_INTERP_SCOPE_SUBREQUEST, MP_INTERP_SCOPE_REQUEST, -MP_INTERP_SCOPE_CONNECTION, +MP_INTERP_SCOPE_CONNECTION } modperl_interp_scope_e; typedef struct { @@ -176,7 +176,7 @@ typedef enum { MP_INPUT_FILTER_MODE, -MP_OUTPUT_FILTER_MODE, +MP_OUTPUT_FILTER_MODE } modperl_filter_mode_e; typedef struct {
cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm
stas01/10/19 03:37:20 Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm Log: - module cleanup, moving XXX/META's into the todo list Revision ChangesPath 1.4 +35 -75modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm Index: RegistryCooker.pm === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- RegistryCooker.pm 2001/10/19 07:35:26 1.3 +++ RegistryCooker.pm 2001/10/19 10:37:20 1.4 @@ -16,9 +16,6 @@ our $VERSION = '1.99'; use Apache::compat (); -# META: Should not use Apache::compat, the following methods need to -# be implemented: -# $r-slurp_filename use Apache::Response; use Apache::Log; @@ -27,27 +24,10 @@ use ModPerl::Util (); use ModPerl::Global (); -# -# issues -# -# - -# META: who sets this? What's the default? unless (defined $ModPerl::Registry::MarkLine) { $ModPerl::Registry::MarkLine = 1; } -### Optimizations -# -# - $o-[CLASS] of the subclass is known at compile time, so should -# create the subs using $o-[CLASS] on the fly for each subclass -# which wants them - -### TODO -# -# - who handles END/BEGIN/,CHECK,INIT) blocks? -# - see META's accross the file - # # debug constants # @@ -58,9 +38,9 @@ use constant D_COMPILE = 4; use constant D_NOISE = 8; -# can override the debug level in httpd.conf with: +# the debug level can be overriden on the main server level of +# httpd.conf with: # PerlSetVar ModPerl::RegistryCooker::DEBUG 4 -# on the server level use Apache::ServerUtil (); use constant DEBUG = defined Apache-server-dir_config('ModPerl::RegistryCooker::DEBUG') @@ -96,26 +76,6 @@ # -# install the aliases into $class -# -# - -sub install_aliases { -my ($class, $rh_aliases) = @_; - -no strict 'refs'; -while (my($k,$v) = each %$rh_aliases) { -if (my $sub = *{$v}{CODE}){ -#warn $class: ok: $k = $v; -*{ $class . ::$k } = $sub; -} -else { -die $class: $k aliasing failed; sub $v doesn't exist; -} -} -} - -# # func: new # dflt: new # args: $class - class to bless into @@ -128,7 +88,6 @@ my($class, $r) = @_; my $o = bless [], $class; $o-init($r); -#$o-debug($$: init class: $class); return $o; } @@ -160,7 +119,6 @@ # __PACKAGE__, which is tied to the file) # -# META: prototyping ($$) segfaults on request sub handler { my $class = (@_ = 2) ? shift : __PACKAGE__; my $r = shift; @@ -219,7 +177,6 @@ $o-flush_namespace; -# META: handle! #$o-chdir_file($Apache::Server::CWD/); if ( ($rc = $o-error_check) != Apache::OK) { @@ -291,9 +248,6 @@ # make sure that the sub-package doesn't start with a digit $package = _$package; -# META: ??? explain -$ModPerl::Registry::curstash = $package; - # prepend root $package = $o-[CLASS] . ::Cache::$package; @@ -331,12 +285,6 @@ substr($o-[URI], 0, length($o-[URI]) - length($path_info)) : $o-[URI]; -# META: do we handle this? -# if ($ModPerl::Registry::NameWithVirtualHost $o-[REQ]-server-is_virtual) { -# my $name = $o-[REQ]-get_server_name; -# $script_name = join , $name, $script_name if $name; -# } - $script_name =~ s:/+$:/__INDEX__:; return $script_name; @@ -365,10 +313,7 @@ # relative require/open will work. $o-chdir_file; -# META: what's this? -## compile this subroutine into the uniq package name -#$o-debug(handler eval-ing) if DEBUG D_NOISE; -#undef {$o-[PACKAGE]\::handler};# unless $Debug $Debug 4; #avoid warnings +#undef {$o-[PACKAGE]\::handler}; unless DEBUG D_NOISE; #avoid warnings #$o-[PACKAGE]-can('undef_functions') $o-[PACKAGE]-undef_functions; my $line = $o-get_mark_line; @@ -385,22 +330,18 @@ my %orig_inc = %INC; -#warn [-- $eval --]; my $rc = $o-compile(\$eval); $o-debug(qq{compiled package \$o-[PACKAGE]\}) if DEBUG D_NOISE; -# META: handle!
cvs commit: modperl-2.0/ModPerl-Registry TODO
stas01/10/19 03:43:25 Modified:ModPerl-Registry TODO Log: - summarize things that have to be done for Registry Revision ChangesPath 1.2 +44 -26modperl-2.0/ModPerl-Registry/TODO Index: TODO === RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TODO 2001/10/09 12:47:38 1.1 +++ TODO 2001/10/19 10:43:25 1.2 @@ -1,36 +1,54 @@ -- META tags in the modules +RegistryCooker: +### bugs ### - - print STDERR is buffered in test handlers, whereas warn() works - normally. select() helps, but STDERR should be unbuffered in first - place. +- prototyping sub handler($$) segfaults on request +### missing features ### - what's the replacement of NameWithVirtualHost? Obviously we need something - to distinguish between vhs. +- need to port $Apache::__T, to test against when user supplies -T flag. -DougM: well, if possible we should distinguish between the uri and -requested resource instead. in otherwords, we have the: r-uri = -r-filename translation, just need to figure out if r-filename is the -actual filename or a symlink (readlink can be used to get the real -filename). then create a package based on the filename, but with as -few package:: levels as possible (hopefully none beyond -ModPerl::RegistryROOT::filename) +- port Apache::PerlRunXS -DougM: using filenames makes for long packages names == lengthy -lookups and more memory than we need. at least the way it is -currently implemented where each '/' turns into '::'. could be that -s,/,_,g is good enough, but haven't thought about this for a while. -in any case, we should get rid of the NameWithVirtualHost stuff, its -caused too many problems in the past. +- implement RegistryLoader (per module or a single one?) +- implement slurp_filename and remove Apache::compat -Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack -http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2 -Message-ID: [EMAIL PROTECTED] +- $r-chdir_file is not handled/implemented, see todo/api.txt unsafe! +- $Apache::Server::CWD doesn't exist + +- NameWithVirtualHost is not handled + +- need to figure out what's happening with + ModPerl::Registry::MarkLine, why it's not on by default? + +- a cousin of convert_script_to_compiled_handler() in 1.x used to have + 'undef {$o-[PACKAGE]\::handler}' to avoid redefine handler() + warnings in case a user has used -w. also see the undef_functions on + the next line. + +- child_terminate is not implemented see + convert_script_to_compiled_handler(). + +- print STDERR is buffered in test handlers, whereas warn() works + normally. select() helps, but STDERR should be unbuffered in first + place. + +### optimizations ### + +- $o-[CLASS] of the subclass is known at compile time, so should + create the subs using $o-[CLASS] on the fly for each subclass + which wants them + +### nice to have ### + +- in namespace_from_filename() should test whether a file is a symlink + and if so use readlink() to get the real filename. + +### other things ### + +- Bjarni R. Einarsson [EMAIL PROTECTED] has suggested this Registry hack + http://marc.theaimsgroup.com/?l=apache-modperl-devm=98961929702745w=2 + Message-ID: [EMAIL PROTECTED]
cvs commit: modperl-2.0/src/modules/perl modperl_time.h
stas01/10/19 20:35:54 Modified:src/modules/perl modperl_time.h Log: - handle platforms which don't have HZ constant defined Revision ChangesPath 1.2 +8 -2 modperl-2.0/src/modules/perl/modperl_time.h Index: modperl_time.h === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_time.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- modperl_time.h2001/01/21 23:19:03 1.1 +++ modperl_time.h2001/10/20 03:35:54 1.2 @@ -1,6 +1,12 @@ #ifndef MODPERL_TIME_H #define MODPERL_TIME_H +#ifdef HZ +# define MP_HZ HZ +#else +# define MP_HZ 100 +#endif + #ifdef MP_TRACE #define dMP_TIMES \ struct tms start_time; \ @@ -18,9 +24,9 @@ #define MP_PRINT_TIMES(label) \ MP_TRACE_t_do({ \ double utime = \ - (double)(end_time.tms_utime - start_time.tms_utime)/HZ; \ + (double)(end_time.tms_utime - start_time.tms_utime)/MP_HZ; \ double stime = \ - (double)(end_time.tms_stime - start_time.tms_stime)/HZ; \ + (double)(end_time.tms_stime - start_time.tms_stime)/MP_HZ; \ if (utime || stime) { \ MP_TRACE_t(MP_FUNC, %s %5.2f user %5.2f sys\n, \ label, utime, stime); \