perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0 Changes
Date Sat, 15 Nov 2003 21:15:45 GMT
stas        2003/11/15 13:15:45

  Modified:    lib/Apache Status.pm
               .        Changes
  Log:
  provide a workaround for Config::myconfig() which
  fails under threads with (5.8.0 < perl < 5.8.3)
  Submitted by:	Elizabeth Mattijsen <liz@dijkmat.nl>
  
  Revision  Changes    Path
  1.13      +18 -8     modperl-2.0/lib/Apache/Status.pm
  
  Index: Status.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -u -r1.12 -r1.13
  --- Status.pm	15 Nov 2003 20:22:58 -0000	1.12
  +++ Status.pm	15 Nov 2003 21:15:45 -0000	1.13
  @@ -368,16 +368,9 @@
   }
   
   sub status_myconfig {
  -    # XXX: Config::myconfig(); fails under threads with (perl < 5.8.3?)
  -    # "Modification of a read-only value attempted"
  -    # need API to query the mpm and run it only if the mpm is not threaded
  -    # require Config;
  -    # my $myconfig = Config::myconfig();
  -    my $myconfig = "Under construction";
  -    ["<pre>", $myconfig, "</pre>"];
  +    ["<pre>", myconfig(), "</pre>"];
   }
   
  -
   sub status_inh_tree {
       return has(shift, "symdump")
           ? ["<pre>", Devel::Symdump->inh_tree, "</pre>"]
  @@ -817,6 +810,23 @@
       push @m, "</table>";
   
       return join "\n", @m, "<hr>", b_package_size_link($r, $q, $package);
  +}
  +
  +sub myconfig {
  +    require Config;
  +    # Config::myconfig(); fails under threads with (5.8.0 < perl < 5.8.3)
  +    # "Modification of a read-only value attempted"
  +    # provide a workaround
  +    if ($Config::Config{useithreads} and $] > 5.008 and $] < 5.008003) {
  +        return $Config::summary_expanded if $Config::summary_expanded;
  +        (my $summary_expanded = $Config::summary) =~
  +            s{\$(\w+)}
  +             { my $c = $Config::Config{$1}; defined($c) ? $c : 'undef' }ge;
  +        return $summary_expanded;
  +    }
  +    else {
  +        return Config::myconfig();
  +  }
   }
   
   1;
  
  
  
  1.252     +4 -0      modperl-2.0/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.251
  retrieving revision 1.252
  diff -u -u -r1.251 -r1.252
  --- Changes	15 Nov 2003 20:24:34 -0000	1.251
  +++ Changes	15 Nov 2003 21:15:45 -0000	1.252
  @@ -12,6 +12,10 @@
   
   =item 1.99_12-dev
   
  +Apache::Status: provide a workaround for Config::myconfig() which
  +fails under threads with (5.8.0 < perl < 5.8.3) [Elizabeth Mattijsen
  +<liz@dijkmat.nl>]
  +
   Fix Apache::Status::handler to return 'Apache::OK' [Juanma Barranquero
   <lektu@terra.es>]
   
  
  
  

Mime
View raw message