cvs commit: modperl-2.0 Changes
stas2003/12/14 18:50:22 Modified:lib/ModPerl TestRun.pm .Changes Log: MaxClients is now overridable from the t/TEST -maxclients command line option (it was hardcoded before). Revision ChangesPath 1.15 +1 -1 modperl-2.0/lib/ModPerl/TestRun.pm Index: TestRun.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TestRun.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -u -r1.14 -r1.15 --- TestRun.pm12 Dec 2003 05:43:57 - 1.14 +++ TestRun.pm15 Dec 2003 02:50:22 - 1.15 @@ -21,7 +21,7 @@ $self->{conf_opts}->{startup_timeout} = $build->mpm_is_threaded() ? 180 : 120; -$self->{conf_opts}->{maxclients} = MIN_MAXCLIENTS; +$self->{conf_opts}->{maxclients} ||= MIN_MAXCLIENTS; ModPerl::TestConfig->new($self->{conf_opts}); } 1.280 +3 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.279 retrieving revision 1.280 diff -u -u -r1.279 -r1.280 --- Changes 13 Dec 2003 23:40:31 - 1.279 +++ Changes 15 Dec 2003 02:50:22 - 1.280 @@ -12,6 +12,9 @@ =item 1.99_12-dev +MaxClients is now overridable from the t/TEST -maxclients command line +option (it was hardcoded before). [Stas] + Postpone the allocation of the wbucket in filters till the moment it's needed (if at all). Since non-streaming filters aren't going to use that buffer, it's a waste to allocate/free it. [Stas]
cvs commit: modperl-2.0 Changes
stas2003/12/14 19:13:36 Modified:src/modules/perl modperl_mgv.c .Changes Log: Prevent a problem where an autovivified package (stash) prevents from modperl_mgv to load the file with that package (until now it was checking whether the stash existed already and skipped the loading if that was the case). Now checking %INC and attempting to load the module. Reporting the failure only if the module has failed to load and the stash is not defined (so that it's possible to autovivify packages without loading them from an external file). Revision ChangesPath 1.28 +56 -12modperl-2.0/src/modules/perl/modperl_mgv.c Index: modperl_mgv.c === RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_mgv.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -u -r1.27 -r1.28 --- modperl_mgv.c 18 Sep 2003 07:58:46 - 1.27 +++ modperl_mgv.c 15 Dec 2003 03:13:36 - 1.28 @@ -181,6 +181,31 @@ } #endif + +static void package2filename(apr_pool_t *p, const char *package, + char **filename, int *len) +{ +*filename = apr_palloc(p, (strlen(package)+4)*sizeof(char)); +const char *s; +char *d; + +for (s = package, d = *filename; *s; s++, d++) { +if (*s == ':' && s[1] == ':') { +*d = '/'; +s++; +} +else { +*d = *s; +} +} +*d++ = '.'; +*d++ = 'p'; +*d++ = 'm'; +*d = '\0'; + +*len = d - *filename; +} + /* currently used for complex filters attributes parsing */ /* XXX: may want to generalize it for any handlers */ #define MODPERL_MGV_DEEP_RESOLVE(handler, p) \ @@ -259,23 +284,42 @@ } } -if (!(stash || (stash = gv_stashpv(name, FALSE))) && -MpHandlerAUTOLOAD(handler)) { -MP_TRACE_h(MP_FUNC, - "package %s not defined, attempting to load\n", name); - -if (modperl_require_module(aTHX_ name, FALSE)) { -MP_TRACE_h(MP_FUNC, "loaded %s package\n", name); -if (!(stash = gv_stashpv(name, FALSE))) { -MP_TRACE_h(MP_FUNC, "%s package still does not exist\n", - name); +if (!stash && MpHandlerAUTOLOAD(handler)) { +int len; +char *filename; +SV **svp; + +package2filename(p, name, &filename, &len); +svp = hv_fetch(GvHVn(PL_incgv), filename, len, 0); + +if (!(svp && *svp != &PL_sv_undef)) { /* not in %INC */ +MP_TRACE_h(MP_FUNC, + "package %s not in %INC, attempting to load '%s'\n", + name, filename); + +if (modperl_require_module(aTHX_ name, FALSE)) { +MP_TRACE_h(MP_FUNC, "loaded %s package\n", name); +} +else { +MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name); return 0; } } else { -MP_TRACE_h(MP_FUNC, "failed to load %s package\n", name); -return 0; +MP_TRACE_h(MP_FUNC, "package %s seems to be loaded\n" + " $INC{%s)='%s';\n", + name, filename, SvPV_nolen(*svp)); } +} + +/* try to lookup the stash only after loading the module, to avoid + * the case where a stash is autovivified by a user before the + * module was loaded, preventing from loading the module + */ +if (!(stash || (stash = gv_stashpv(name, FALSE { +MP_TRACE_h(MP_FUNC, "package %s seems to be loaded, " + "but can't find its stash\n", name); +return 0; } if ((gv = gv_fetchmethod(stash, handler_name)) && (cv = GvCV(gv))) { 1.281 +8 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.280 retrieving revision 1.281 diff -u -u -r1.280 -r1.281 --- Changes 15 Dec 2003 02:50:22 - 1.280 +++ Changes 15 Dec 2003 03:13:36 - 1.281 @@ -12,6 +12,14 @@ =item 1.99_12-dev +Prevent a problem where an autovivified package (stash) prevents from +modperl_mgv to load the file with that package (until now it was +checking whether the stash existed already and skipped the loading if +that was the case). Now checking %INC and attempting to load the +module. Reporting the failure only if the module has failed to load +and the stash is not defined (so that it's possible to autovivify +packages without loading them from an external file). [Stas] + MaxClients is now overridable from the t/TEST -maxclien
cvs commit: modperl-2.0 Changes
stas2003/12/14 21:29:35 Modified:lib/ModPerl BuildOptions.pm lib/Apache Build.pm .Changes Log: libgtop config (needed for enabling MOD_PERL_TRACE=m) is now searched using the gnome packaging tools if available (pkg-config for gnome-2.x and gnome-config for gnome-1.x) Revision ChangesPath 1.24 +4 -2 modperl-2.0/lib/ModPerl/BuildOptions.pm Index: BuildOptions.pm === RCS file: /home/cvs/modperl-2.0/lib/ModPerl/BuildOptions.pm,v retrieving revision 1.23 retrieving revision 1.24 diff -u -u -r1.23 -r1.24 --- BuildOptions.pm 16 Oct 2003 21:33:28 - 1.23 +++ BuildOptions.pm 15 Dec 2003 05:29:35 - 1.24 @@ -4,6 +4,7 @@ use warnings; use Apache::Build (); +use Apache::TestTrace; my $param_qr = qr([\s=]+); use constant VERBOSE => 1; @@ -21,8 +22,9 @@ parse_file($build); parse_argv($build); -if ($build->{MP_DEBUG} and $build->{MP_USE_GTOP}) { -$build->{MP_USE_GTOP} = 0 unless $build->find_dlfile('gtop'); +if ($build->{MP_DEBUG} and $build->{MP_USE_GTOP} and !$build->find_gtop) { +error "Can't find libgtop, resetting MP_USE_GTOP=0"; +$build->{MP_USE_GTOP} = 0; } unless ($build->{MP_USE_DSO} or $build->{MP_USE_STATIC}) { 1.151 +63 -1 modperl-2.0/lib/Apache/Build.pm Index: Build.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/Build.pm,v retrieving revision 1.150 retrieving revision 1.151 diff -u -u -r1.150 -r1.151 --- Build.pm 7 Nov 2003 08:48:21 - 1.150 +++ Build.pm 15 Dec 2003 05:29:35 - 1.151 @@ -196,9 +196,62 @@ #--- Perl Config stuff --- +my %gtop_config = (); +sub find_gtop { +my $self = shift; + +return %gtop_config if %gtop_config; + +if (%gtop_config = find_gtop_config()) { +return %gtop_config; +} + +if ($self->find_dlfile('gtop')) { +$gtop_config{ldopts} = $self->gtop_ldopts_old(); +$gtop_config{ccopts} = ''; +return %gtop_config; +} + +return (); +} + +sub find_gtop_config { +my %c = (); + +if (system('pkg-config --exists libgtop-2.0') == 0) { +# 2.x +chomp($c{ccopts} = qx|pkg-config --cflags libgtop-2.0|); +chomp($c{ldopts} = qx|pkg-config --libs libgtop-2.0|); + +# 2.0.0 bugfix +chomp(my $libdir = qx|pkg-config --variable=libdir libgtop-2.0|); +$c{ldopts} =~ s|\$\(libdir\)|$libdir|; +} +elsif (system('gnome-config --libs libgtop') == 0) { +chomp($c{ccopts} = qx|gnome-config --cflags libgtop|); +chomp($c{ldopts} = qx|gnome-config --libs libgtop|); + +# buggy ( < 1.0.9?) versions fixup +$c{ccopts} =~ s|^/|-I/|; +$c{ldopts} =~ s|^/|-L/|; +} + +if ($c{ccopts}) { +chomp(my $ginc = `glib-config --cflags`); +$c{ccopts} .= " $ginc"; +} + +if (%c) { +$c{ccopts} = " $c{ccopts}"; +$c{ldopts} = " $c{ldopts}"; +} + +return %c; +} + my @Xlib = qw(/usr/X11/lib /usr/X11R6/lib); -sub gtop_ldopts { +sub gtop_ldopts_old { my $self = shift; my $xlibs = ""; @@ -214,6 +267,14 @@ return " -lgtop -lgtop_sysdeps -lgtop_common $xlibs"; } +sub gtop_ldopts { +exists $gtop_config{ldopts} ? $gtop_config{ldopts} : ''; +} + +sub gtop_ccopts { +exists $gtop_config{ccopts} ? $gtop_config{ccopts} : ''; +} + sub ldopts { my($self) = @_; @@ -266,6 +327,7 @@ if ($self->{MP_USE_GTOP}) { $ccopts .= " -DMP_USE_GTOP"; +$ccopts .= $self->gtop_ccopts; } if ($self->{MP_MAINTAINER}) { 1.282 +4 -0 modperl-2.0/Changes Index: Changes === RCS file: /home/cvs/modperl-2.0/Changes,v retrieving revision 1.281 retrieving revision 1.282 diff -u -u -r1.281 -r1.282 --- Changes 15 Dec 2003 03:13:36 - 1.281 +++ Changes 15 Dec 2003 05:29:35 - 1.282 @@ -12,6 +12,10 @@ =item 1.99_12-dev +libgtop config (needed for enabling MOD_PERL_TRACE=m) is now searched +using the gnome packaging tools if available (pkg-config for gnome-2.x +and gnome-config for gnome-1.x) [Stas] + Prevent a problem where an autovivified package (stash) prevents from modperl_mgv to load the file with that package (until now it was checking whether the stash existed already and skipped the loading if