perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm
Date Tue, 25 Nov 2003 18:56:34 GMT
geoff       2003/11/25 10:56:34

  Modified:    xs/maps  apache_functions.map modperl_functions.map
               xs/tables/current/ModPerl FunctionTable.pm
  Added:       t/response/TestAPI mpm_query.pm show_mpm.pm
               xs/Apache/MPM Apache__MPM.h
  Log:
  add Apache::MPM class, along with show_mpm() and mpm_query() functions
  
  Revision  Changes    Path
  1.1                  modperl-2.0/t/response/TestAPI/mpm_query.pm
  
  Index: mpm_query.pm
  ===================================================================
  package TestAPI::mpm_query;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestTrace;
  
  use Apache::MPM ();
  
  use Apache::Const -compile => qw(OK :mpmq);
  
  sub handler {
      my $r = shift;
  
      plan $r, tests => 3;
  
      # ok, this isn't particularly pretty, but I can't think
      # of a better way to do it
      # all of these attributes I pulled right from the C sources
  
      my $mpm = lc Apache::MPM::show_mpm;
  
      if ($mpm eq 'prefork') {
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_THREADED);
  
              ok t_cmp(Apache::MPMQ_NOT_SUPPORTED,
                       $query,
                       "MPMQ_IS_THREADED ($mpm)");
          }
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_FORKED);
  
              ok t_cmp(Apache::MPMQ_DYNAMIC,
                       $query,
                       "MPMQ_IS_FORKED ($mpm)");
          }
  
          # the underlying call for Apache::MPM_IS_THREADED is ap_mpm_query
          # so might as well test is here...
  
          t_debug('Apache::MPM_IS_THREADED returned ' . Apache::MPM_IS_THREADED);
          ok (! Apache::MPM_IS_THREADED);
  
      }
      elsif ($mpm eq 'worker') {
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_THREADED);
  
              ok t_cmp(Apache::MPMQ_STATIC,
                       $query,
                       "MPMQ_IS_THREADED ($mpm)");
          }
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_FORKED);
  
              ok t_cmp(Apache::MPMQ_DYNAMIC,
                       $query,
                       "MPMQ_IS_FORKED ($mpm)");
          }
  
          t_debug('Apache::MPM_IS_THREADED returned ' . Apache::MPM_IS_THREADED);
          ok (Apache::MPM_IS_THREADED);
  
      }
      elsif ($mpm eq 'leader') {
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_THREADED);
  
              ok t_cmp(Apache::MPMQ_STATIC,
                       $query,
                       "MPMQ_IS_THREADED ($mpm)");
          }
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_FORKED);
  
              ok t_cmp(Apache::MPMQ_DYNAMIC,
                       $query,
                       "MPMQ_IS_FORKED ($mpm)");
          }
  
          t_debug('Apache::MPM_IS_THREADED returned ' . Apache::MPM_IS_THREADED);
          ok (Apache::MPM_IS_THREADED);
  
      }
      elsif ($mpm eq 'winnt') {
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_THREADED);
  
              ok t_cmp(Apache::MPMQ_STATIC,
                       $query,
                       "MPMQ_IS_THREADED ($mpm)");
          }
  
          {
              my $query = Apache::MPM::mpm_query(Apache::MPMQ_IS_FORKED);
  
              ok t_cmp(Apache::MPMQ_NOT_SUPPORTED,
                       $query,
                       "MPMQ_IS_FORKED ($mpm)");
          }
  
          t_debug('Apache::MPM_IS_THREADED returned ' . Apache::MPM_IS_THREADED);
          ok (Apache::MPM_IS_THREADED);
  
      }
      else {
          skip "skipping MPMQ_IS_THREADED test for $mpm MPM", 0;
          skip "skipping MPMQ_IS_FORKED test for $mpm MPM", 0;
          skip "skipping Apache::MPM_IS_THREADED test for $mpm MPM", 0;
      }
  
      Apache::OK;
  }
  
  1;
  
  
  
  1.1                  modperl-2.0/t/response/TestAPI/show_mpm.pm
  
  Index: show_mpm.pm
  ===================================================================
  package TestAPI::show_mpm;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use Apache::MPM ();
  
  use Apache::Const -compile => 'OK';
  
  sub handler {
      my $r = shift;
  
      plan $r, tests => 1;
  
      my $mpm = Apache::Test::config->{server}->{mpm};
  
      ok t_cmp(qr!$mpm!i,
               Apache::MPM::show_mpm,
               'Apache::MPM::show_mpm()');
  
      Apache::OK;
  }
  
  1;
  
  
  
  1.1                  modperl-2.0/xs/Apache/MPM/Apache__MPM.h
  
  Index: Apache__MPM.h
  ===================================================================
  static MP_INLINE
  int mpxs_Apache__MPM_mpm_query(int query)
  {
      int mpm_query_info;
  
      apr_status_t retval = ap_mpm_query(query, &mpm_query_info);
  
      if (retval == APR_SUCCESS) {
          return mpm_query_info;
      }
  
      /* XXX hmm... what to do here.  die?
       * APR_ENOTIMPL should be sufficiently large
       * that comparison tests fail... I think...
       */
      return (int) retval;
  }
  
  
  
  1.65      +23 -23    modperl-2.0/xs/maps/apache_functions.map
  
  Index: apache_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/apache_functions.map,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- apache_functions.map	12 Jun 2003 23:27:03 -0000	1.64
  +++ apache_functions.map	25 Nov 2003 18:56:34 -0000	1.65
  @@ -488,28 +488,28 @@
   !MODULE=Apache::XML
    ap_xml_parse_input
   
  -!MODULE=Apache::MPM
  +MODULE=Apache::MPM
    ap_mpm_query
   >ap_mpm_run
  - ap_os_create_privileged_process
  - ap_wait_or_timeout
  - ap_graceful_stop_signalled
  - ap_process_child_status
  - ap_reclaim_child_processes
  - ap_sock_disable_nagle
  - ap_gname2id
  - ap_uname2id
  - ap_lingering_close
  - ap_mpm_pod_check
  - ap_mpm_pod_close
  - ap_mpm_pod_killpg
  - ap_mpm_pod_open
  - ap_mpm_pod_signal
  - ap_mpm_set_accept_lock_mech
  - ap_mpm_set_coredumpdir
  - ap_mpm_set_lockfile
  - ap_mpm_set_max_requests
  - ap_mpm_set_pidfile
  - ap_mpm_set_scoreboard
  -?ap_show_mpm
  - ap_listen_pre_config
  +?ap_os_create_privileged_process
  +?ap_wait_or_timeout
  +?ap_graceful_stop_signalled
  +?ap_process_child_status
  +?ap_reclaim_child_processes
  +?ap_sock_disable_nagle
  +?ap_gname2id
  +?ap_uname2id
  +?ap_lingering_close
  +?ap_mpm_pod_check
  +?ap_mpm_pod_close
  +?ap_mpm_pod_killpg
  +?ap_mpm_pod_open
  +?ap_mpm_pod_signal
  +?ap_mpm_set_accept_lock_mech
  +?ap_mpm_set_coredumpdir
  +?ap_mpm_set_lockfile
  +?ap_mpm_set_max_requests
  +?ap_mpm_set_pidfile
  +?ap_mpm_set_scoreboard
  + ap_show_mpm
  +?ap_listen_pre_config
  
  
  
  1.60      +3 -0      modperl-2.0/xs/maps/modperl_functions.map
  
  Index: modperl_functions.map
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/maps/modperl_functions.map,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- modperl_functions.map	6 Nov 2003 11:22:02 -0000	1.59
  +++ modperl_functions.map	25 Nov 2003 18:56:34 -0000	1.60
  @@ -134,3 +134,6 @@
   
   MODULE=Apache::CmdParms
    mpxs_Apache__CmdParms_info
  +
  +MODULE=Apache::MPM
  + mpxs_Apache__MPM_mpm_query
  
  
  
  1.131     +10 -0     modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm,v
  retrieving revision 1.130
  retrieving revision 1.131
  diff -u -r1.130 -r1.131
  --- FunctionTable.pm	17 Nov 2003 23:27:11 -0000	1.130
  +++ FunctionTable.pm	25 Nov 2003 18:56:34 -0000	1.131
  @@ -6898,6 +6898,16 @@
         }
       ]
     },
  +  {
  +    'return_type' => 'int',
  +    'name' => 'mpxs_Apache__MPM_mpm_query',
  +    'args' => [
  +      {
  +        'type' => 'int',
  +        'name' => 'query'
  +      }
  +    ]
  +  },
   ];
   
   
  
  
  

Mime
View raw message