cvs commit: modperl/t/net/perl/io perlio.pl

2000-12-19 Thread dougm

dougm   00/12/20 00:07:37

  Modified:.Changes
   Apache   Apache.pm
   src/modules/perl Apache.xs
   t/internal http-get.t
   t/net/perl/io perlio.pl
  Log:
  rewrite of Apache::WRITE() in c/xs
  
  Revision  ChangesPath
  1.556 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.555
  retrieving revision 1.556
  diff -u -r1.555 -r1.556
  --- Changes   2000/12/20 07:24:42 1.555
  +++ Changes   2000/12/20 08:07:32 1.556
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +rewrite of Apache::WRITE() in c/xs
  +[Soheil Seyfaie <[EMAIL PROTECTED]>]
  +
   prevent $PerlRequire in a  section from triggering an endless loop
   [Salvador Ortiz Garcia <[EMAIL PROTECTED]>]
   
  
  
  
  1.60  +0 -6  modperl/Apache/Apache.pm
  
  Index: Apache.pm
  ===
  RCS file: /home/cvs/modperl/Apache/Apache.pm,v
  retrieving revision 1.59
  retrieving revision 1.60
  diff -u -r1.59 -r1.60
  --- Apache.pm 2000/11/25 15:39:24 1.59
  +++ Apache.pm 2000/12/20 08:07:34 1.60
  @@ -158,12 +158,6 @@
   }
   *printf = \&PRINTF;
   
  -sub WRITE {
  -my($r, $buff, $length, $offset) = @_;
  -my $send = substr($buff, $offset, $length);
  -$r->print($send);
  -}
  -
   sub send_cgi_header {
   my($r, $headers) = @_;
   my $dlm = "\015?\012"; #a bit borrowed from LWP::UserAgent
  
  
  
  1.117 +48 -0 modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- Apache.xs 2000/12/20 07:02:49 1.116
  +++ Apache.xs 2000/12/20 08:07:35 1.117
  @@ -1035,6 +1035,54 @@
   }
   
   int
  +write(r, sv_buffer, sv_length=-1, offset=0)
  +Apache   r
  +SV *sv_buffer
  +int sv_length
  +int offset
  +
  +ALIAS:
  +Apache::WRITE = 1
  +
  +PREINIT:
  +STRLEN len;
  +char *buffer;
  +int sent = 0;
  +
  +CODE:
  +ix = ix; /* avoid -Wall warning */
  +RETVAL = 0;
  +
  +if (r->connection->aborted) {
  +XSRETURN_UNDEF;
  +}
  +
  +buffer = SvPV(sv_buffer, len);
  +if (sv_length != -1) {
  +len = sv_length;
  +}
  +
  +if (offset) {
  +buffer += offset;
  +}
  +
  +while (len > 0) {
  +sent = rwrite(buffer,
  +  len < HUGE_STRING_LEN ? len : HUGE_STRING_LEN,
  +  r);
  +if (sent < 0) {
  +rwrite_neg_trace(r);
  + break;
  +}
  +buffer += sent;
  +len -= sent;
  +RETVAL += sent;
  +}
  +
  +OUTPUT:
  +RETVAL
  +
  +int
   print(r, ...)
   Apache   r
   
  
  
  
  1.7   +25 -2 modperl/t/internal/http-get.t
  
  Index: http-get.t
  ===
  RCS file: /home/cvs/modperl/t/internal/http-get.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- http-get.t2000/10/10 16:33:59 1.6
  +++ http-get.t2000/12/20 08:07:36 1.7
  @@ -7,8 +7,10 @@
   my(@test_scripts) = qw(test perl-status);
   %get_only = map { $_,1 } qw(perl-status);
   
  +my(@sys_tests) = qw(syswrite_1 syswrite_2 syswrite_3);
  +
   if($] > 5.003) {
  -$num_tests += 3;
  +$num_tests += (3 + @sys_tests);
   push @test_scripts, qw(io/perlio.pl);
   }
   
  @@ -42,7 +44,28 @@
   next if $get_only{$s};
   
   test ++$i, ($str =~ /^REQUEST_METHOD=GET$/m); 
  -test ++$i, ($str =~ /^QUERY_STRING=query$/m); 
  +test ++$i, ($str =~ /^QUERY_STRING=query$/m);
  +
  +if ($s eq 'io/perlio.pl') {
  +foreach my $h (@sys_tests) {
  +$url = new URI::URL("http://$netloc$script?$h");
  +
  +$request = new HTTP::Request('GET', $url);
  +
  +print "GET $url\n\n";
  +
  +$response = $ua->request($request, undef, undef);
  +
  +$str = $response->as_string;
  +print "$str\n";
  +if ($h eq 'syswrite_noheader') {
  +test ++$i, $str =~ /(Internal Server Error)/;
  +} else {
  +die "$1\n" if $str =~ /(Internal Server Error)/;
  +test ++$i, ($response->is_success);
  +}
  +}
  +}
   }
   
   my $mp_version;
  
  
  
  1.6   +51 -0 modperl/t/net/perl/io/perlio.pl
  
  Index: perlio.pl
  ===
  RCS file: /home/cvs/modperl/t/net/perl/io/perlio.pl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- perlio.pl 1999/05/18 02:08:33 1.5
  +++ perlio.pl 200

cvs commit: modperl INSTALL.win32

2000-12-19 Thread dougm

dougm   00/12/19 23:32:12

  Modified:.INSTALL.win32
  Log:
  typo fix and binary dist update
  
  Revision  ChangesPath
  1.4   +2 -5  modperl/INSTALL.win32
  
  Index: INSTALL.win32
  ===
  RCS file: /home/cvs/modperl/INSTALL.win32,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- INSTALL.win32 1998/03/24 04:19:48 1.3
  +++ INSTALL.win32 2000/12/20 07:32:12 1.4
  @@ -25,11 +25,8 @@
   
   =item Binaries
   
  -Jeffey Baker maintains the binary distribution of mod_perl available
  -from: 
  +See: http://perl.apache.org/distributions.html
   
  - http://www.perl.com/CPAN/authors/Jeffrey_Baker/
  -
   =item Setup the Perl side
   
   run 'perl Makefile.PL'
  @@ -87,7 +84,7 @@
   
   Add this line to httpd.conf:
   
  - LoadModule perl_module modules/ApacheModulePerl
  + LoadModule perl_module modules/ApacheModulePerl.dll
   
   Be sure that 'C:\perl\bin' is in your path so apache can find perl.dll
   
  
  
  



cvs commit: modperl/src/modules/perl mod_perl.h

2000-12-19 Thread dougm

dougm   00/12/19 23:24:43

  Modified:.Changes
   src/modules/perl mod_perl.h
  Log:
  prevent $PerlRequire in a  section from triggering an endless loop
  
  Revision  ChangesPath
  1.555 +4 -1  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.554
  retrieving revision 1.555
  diff -u -r1.554 -r1.555
  --- Changes   2000/12/20 07:10:24 1.554
  +++ Changes   2000/12/20 07:24:42 1.555
  @@ -10,7 +10,10 @@
   
   =item 1.24_02-dev
   
  -Build fix for using gcc with AIX
  +prevent $PerlRequire in a  section from triggering an endless loop
  +[Salvador Ortiz Garcia <[EMAIL PROTECTED]>]
  +
  +build fix for using gcc with AIX
   [Jens-Uwe Mager <[EMAIL PROTECTED]>]
   
   allow modification of $r->hostname
  
  
  
  1.106 +3 -2  modperl/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.h,v
  retrieving revision 1.105
  retrieving revision 1.106
  diff -u -r1.105 -r1.106
  --- mod_perl.h2000/10/03 18:19:14 1.105
  +++ mod_perl.h2000/12/20 07:24:43 1.106
  @@ -491,9 +491,10 @@
   #ifdef PERL_SECTIONS
   # ifndef PERL_SECTIONS_SELF_BOOT
   #  ifdef WIN32
  -#   define PERL_SECTIONS_SELF_BOOT getenv("PERL_SECTIONS_SELF_BOOT")
  +#   define PERL_SECTIONS_SELF_BOOT \
  +   (getenv("PERL_SECTIONS_SELF_BOOT") && !perl_sections_self_boot)
   #  else
  -#   define PERL_SECTIONS_SELF_BOOT 1
  +#   define PERL_SECTIONS_SELF_BOOT !perl_sections_self_boot
   #  endif
   # endif
   #endif
  
  
  



cvs commit: modperl Changes

2000-12-19 Thread dougm

dougm   00/12/19 23:10:25

  Modified:apacimod_perl.config.sh
   .Changes
  Log:
  build fix for using gcc with AIX
  
  Revision  ChangesPath
  1.20  +9 -2  modperl/apaci/mod_perl.config.sh
  
  Index: mod_perl.config.sh
  ===
  RCS file: /home/cvs/modperl/apaci/mod_perl.config.sh,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- mod_perl.config.sh2000/09/26 20:15:06 1.19
  +++ mod_perl.config.sh2000/12/20 07:10:24 1.20
  @@ -118,7 +118,14 @@
   perl_lddlflags="`$perl_interp $config_pm -e 'print $Config{lddlflags}'`"
   
   case "$os_version" in
  -aix*)  perl_lddlflags="$perl_lddlflags -bI:\$(APACHELIBEXEC)/httpd.exp" ;;
  +aix*)
  + case "$perl_cc" in
  + *gcc*)
  + XLINKER="-Xlinker "
  + ;;
  + esac
  + perl_lddlflags="$perl_lddlflags $XLINKER-bI:\$(APACHELIBEXEC)/httpd.exp"
  + ;;
   * );;
   esac
   
  @@ -150,7 +157,7 @@
   if test $build_type = OBJ
   then
case "$os_version" in
  - aix*)  perl_libs="$perl_libs -bE:\$(SRCDIR)/modules/perl/mod_perl.exp" ;;
  + aix*)  perl_libs="$perl_libs 
$XLINKER-bE:\$(SRCDIR)/modules/perl/mod_perl.exp" ;;
* );;
esac
   fi
  
  
  
  1.554 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.553
  retrieving revision 1.554
  diff -u -r1.553 -r1.554
  --- Changes   2000/12/20 07:02:48 1.553
  +++ Changes   2000/12/20 07:10:24 1.554
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +Build fix for using gcc with AIX
  +[Jens-Uwe Mager <[EMAIL PROTECTED]>]
  +
   allow modification of $r->hostname
   [Jim Winstead <[EMAIL PROTECTED]>]
   
  
  
  



cvs commit: modperl/src/modules/perl Apache.xs

2000-12-19 Thread dougm

dougm   00/12/19 23:02:49

  Modified:.Changes
   src/modules/perl Apache.xs
  Log:
  allow modification of $r->hostname
  
  Revision  ChangesPath
  1.553 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.552
  retrieving revision 1.553
  diff -u -r1.552 -r1.553
  --- Changes   2000/12/20 06:47:45 1.552
  +++ Changes   2000/12/20 07:02:48 1.553
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +allow modification of $r->hostname
  +[Jim Winstead <[EMAIL PROTECTED]>]
  +
   allow Makefile.PL to build mod_perl on Win32 using VC++
   [Randy Kobes <[EMAIL PROTECTED]>]
   
  
  
  
  1.116 +2 -2  modperl/src/modules/perl/Apache.xs
  
  Index: Apache.xs
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/Apache.xs,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- Apache.xs 2000/10/03 18:19:13 1.115
  +++ Apache.xs 2000/12/20 07:02:49 1.116
  @@ -1443,11 +1443,11 @@
   RETVAL
   
   char *
  -hostname(r)
  +hostname(r, ...)
   Apache   r
   
   CODE:
  -RETVAL = (char *)r->hostname;
  +get_set_PVp(r->hostname,r->pool);
   
   OUTPUT:
   RETVAL
  
  
  



cvs commit: modperl Changes Makefile.PL

2000-12-19 Thread dougm

dougm   00/12/19 22:47:46

  Modified:.Changes Makefile.PL
  Log:
  allow Makefile.PL to build mod_perl on Win32 using VC++
  
  Revision  ChangesPath
  1.552 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.551
  retrieving revision 1.552
  diff -u -r1.551 -r1.552
  --- Changes   2000/12/20 06:39:47 1.551
  +++ Changes   2000/12/20 06:47:45 1.552
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +allow Makefile.PL to build mod_perl on Win32 using VC++
  +[Randy Kobes <[EMAIL PROTECTED]>]
  +
   stop win32 crash when bringing down service
   [John K. Sterling <[EMAIL PROTECTED]>]
   
  
  
  
  1.171 +180 -3modperl/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl/Makefile.PL,v
  retrieving revision 1.170
  retrieving revision 1.171
  diff -u -r1.170 -r1.171
  --- Makefile.PL   2000/10/03 14:17:22 1.170
  +++ Makefile.PL   2000/12/20 06:47:45 1.171
  @@ -313,8 +313,21 @@
   }
   }
   
  +my $vcpp = ($Config{cc} =~ /^cl(\.exe)?$/);
  +my %win32_args;
  +my %win32_accept = map {$_ => 1} qw(APACHE_SRC INSTALL_DLL DEBUG EAPI);
  +
   while($_ = shift) {
   ($k,$v) = split /=/, $_, 2;
  +if ($vcpp) {
  +  if ($win32_accept{$k}) {
  + $win32_args{$k} = ($k eq 'DEBUG' or $k eq 'EAPI') ? 1 : $v;
  +  }
  +  else {
  + push @mm_args, $_;
  +  }
  +  next;
  +}
   unless (/^(PERL|APACHE)/ or is_mp_arg($k)) {
push @mm_args, $_;
   }
  @@ -327,6 +340,8 @@
   $callback_hooks{$k} = $v if exists $callback_hooks{$k};
   }
   
  +my $win32_auto = ($vcpp and $win32_args{APACHE_SRC}) ? 1 : 0;
  +
   my %very_experimental = map {$_,1} 
   qw(PERL_DEFAULT_OPMASK PERL_SAFE_STARTUP PERL_ORALL_OPMASK 
  PERL_STARTUP_DONE_CHECK PERL_DSO_UNLOAD);
  @@ -867,6 +882,13 @@
   
   init_config_pl() if $Is_Win32;
   
  +my (%win32_path);
  +if ($win32_auto) {
  +  use File::Spec;
  +  win32_inc_and_lib();
  +  win32_fix_dsp();
  +}
  +
   write_my_config($APACHE_SRC);
   
   unless($Is_Win32 or -e "t/conf/httpd.conf" or ($NO_HTTPD && !$PREP_HTTPD)) {
  @@ -1227,6 +1249,13 @@
   sub MY::clean {
   my $self = shift;
   my $string = $self->MM::clean(@_);
  +if ($win32_auto) {
  +  $string .= sprintf 
  + qq{\tmsdev src\\modules\\ApacheModulePerl\\ApacheModulePerl.dsp \\\n} .
  +   qq{\t/MAKE "ApacheModulePerl - Win32 %s" /CLEAN\n}, 
  +   ($win32_args{DEBUG} == 1) ? 'Debug' : 'Release';
  +  return $string;
  +}
   unless($NO_HTTPD) {
my $asrc = asrc($APACHE_SRC, "http_main.c");
return $string unless $APACHE_SRC and -e "$asrc/http_main.c";
  @@ -1245,12 +1274,15 @@
   if($USE_APXS) {
$add = "apxs_install";
   }
  +elsif ($win32_auto and $win32_args{INSTALL_DLL}) {
  +  $add = 'amp_install';
  +}
   elsif($USE_APACI) {
if($APACI_ARGS =~ /--prefix=/ or $APACHE_PREFIX) {
$add = "apaci_install";
}
   }
  -if($add and (!$NO_HTTPD and !$PREP_HTTPD) or $USE_APXS) {
  +if($add and (!$NO_HTTPD and !$PREP_HTTPD) or $USE_APXS or $win32_auto) {
$string =~ s/(pure_install\s+)(.*)/$1 $add $2/;
   }
   return $string;
  @@ -1259,7 +1291,20 @@
   sub MY::top_targets {
   my $self = shift;
   my $string = $self->MM::top_targets;
  -return $string unless $USE_APXS or $USE_APACI or $APACHE_SRC;
  +return $string unless $USE_APXS or $USE_APACI or $APACHE_SRC or $win32_auto;
  +
  +if ($win32_auto) {
  +  $string =~ s/(pure_all\s+::.*\s+subdirs\s+)(.*)/$1 amp_dll $2/;
  +  $string .= sprintf qq{\namp_dll:\n} . 
  + qq{\tmsdev src\\modules\\ApacheModulePerl\\ApacheModulePerl.dsp \\\n} .
  +   qq{\t/MAKE "ApacheModulePerl - Win32 %s" /USEENV\n}, 
  +   ($win32_args{DEBUG} == 1) ? 'Debug' : 'Release';
  +  if ($win32_args{INSTALL_DLL}) {
  + $string .= sprintf qq{\namp_install:\n\t\$(CP) "%s" "%s"}, 
  + "$win32_path{MODPERL_LIB}/ApacheModulePerl.dll", $win32_args{INSTALL_DLL};
  +  }
  +  return $string;
  +}
   
   if($USE_APXS) {
$string =~ s/(pure_all\s+::\s+)(.*)/$1 apxs_libperl $2/;
  @@ -1890,6 +1935,17 @@
   
   sub write_my_config {
   my $src = shift;
  +
  +my $string;
  +if ($win32_auto) {
  +  $string =<<"EOS";
  +'APACHE_INC' => '$win32_path{APACHE_INC}',
  +   'APACHE_LIB' => '$win32_path{APACHE_LIB}',
  +   'MODPERL_INC' => '$win32_path{MODPERL_INC}',
  +   'MODPERL_LIB' => '$win32_path{MODPERL_LIB}',
  +EOS
  +}
  +
   local *FH;
   # writing Configuration to Apache::MyConfig
   
  @@ -1897,7 +1953,7 @@
die "Can't open lib/Apache/MyConfig.pm: $!";
   print FH < \'$APACHE_SRC\',
  'SSL_BASE' => \'$SSL_BASE\',
  'APXS' => \'$WITH_APXS\',
  +   $s

cvs commit: modperl/src/modules/perl mod_perl.c

2000-12-19 Thread dougm

dougm   00/12/19 22:39:48

  Modified:.Changes
   src/modules/perl mod_perl.c
  Log:
  stop win32 crash when bringing down service
  
  Revision  ChangesPath
  1.551 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.550
  retrieving revision 1.551
  diff -u -r1.550 -r1.551
  --- Changes   2000/12/20 06:34:19 1.550
  +++ Changes   2000/12/20 06:39:47 1.551
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +stop win32 crash when bringing down service
  +[John K. Sterling <[EMAIL PROTECTED]>]
  +
   various Apache::test enhancements and fixes
   [Ken Williams <[EMAIL PROTECTED]>, Dave Rolsky <[EMAIL PROTECTED]>]
   
  
  
  
  1.134 +15 -1 modperl/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl.c,v
  retrieving revision 1.133
  retrieving revision 1.134
  diff -u -r1.133 -r1.134
  --- mod_perl.c2000/10/06 20:18:28 1.133
  +++ mod_perl.c2000/12/20 06:39:48 1.134
  @@ -507,7 +507,21 @@
   
   static void mp_dso_unload(void *data) 
   { 
  -array_header *librefs = xs_dl_librefs((pool *)data);
  +array_header *librefs;
  +
  +#ifdef WIN32
  +// This is here to stop a crash when bringing down
  +// a service.  Apparently the dso is unloaded too early.
  +// This if statement tests to see if we are running as a 
  +// service. apache does the same
  +// see apache's isProcessService() in service.c 
  +if (AllocConsole()) {
  +FreeConsole();
  +return;
  +} 
  +#endif
  +
  +librefs = xs_dl_librefs((pool *)data);
   perl_shutdown(NULL, NULL);
   unload_xs_so(librefs);
   } 
  
  
  



cvs commit: modperl/lib/Apache test.pm

2000-12-19 Thread dougm

dougm   00/12/19 22:34:20

  Modified:.Changes
   lib/Apache test.pm
  Log:
  various Apache::test enhancements and fixes
  
  Revision  ChangesPath
  1.550 +3 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.549
  retrieving revision 1.550
  diff -u -r1.549 -r1.550
  --- Changes   2000/11/25 15:39:21 1.549
  +++ Changes   2000/12/20 06:34:19 1.550
  @@ -10,6 +10,9 @@
   
   =item 1.24_02-dev
   
  +various Apache::test enhancements and fixes
  +[Ken Williams <[EMAIL PROTECTED]>, Dave Rolsky <[EMAIL PROTECTED]>]
  +
   Documenting the new PerlAddVar httpd.conf directive
   [Stas Bekman <[EMAIL PROTECTED]>]
   
  
  
  
  1.21  +24 -8 modperl/lib/Apache/test.pm
  
  Index: test.pm
  ===
  RCS file: /home/cvs/modperl/lib/Apache/test.pm,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- test.pm   2000/10/13 17:21:18 1.20
  +++ test.pm   2000/12/20 06:34:20 1.21
  @@ -1,14 +1,15 @@
   package Apache::test;
   
   use strict;
  -use vars qw(@EXPORT $USE_THREAD $USE_SFIO $PERL_DIR);
  +use vars qw(@EXPORT $USE_THREAD $USE_SFIO $PERL_DIR @EXPORT_OK);
   use Exporter ();
   use Config;
   use FileHandle ();
   *import = \&Exporter::import;
   
  -@EXPORT = qw(test fetch simple_fetch have_module skip_test 
  +@EXPORT = qw(test fetch simple_fetch have_module skip_test
 $USE_THREAD $USE_SFIO $PERL_DIR WIN32 grab run_test); 
  +@EXPORT_OK = qw(have_httpd);
   
   BEGIN { 
   if(not $ENV{MOD_PERL}) {
  @@ -86,14 +87,15 @@
   
   sub _ask {
   # Just a function for asking the user questions
  -my ($prompt, $default, $mustfind) = @_;
  +my ($prompt, $default, $mustfind, $canskip) = @_;
   
  +my $skip = defined $canskip ? " ('$canskip' to skip)" : '';
   my $response;
   do {
  - print "$prompt [$default]: ";
  + print "$prompt [$default]$skip: ";
chomp($response = );
$response ||= $default;
  -} until (!$mustfind || (-e $response || !print("$response not found\n")));
  +} until (!$mustfind || ($response eq $canskip) || (-e $response || 
!print("$response not found\n")));
   
   return $response;
   }
  @@ -108,10 +110,16 @@
   
   my $httpd = $ENV{'APACHE'} || which('apache') || which('httpd') || 
'/usr/lib/httpd/httpd';
   
  -$httpd = _ask("\n", $httpd, 1);
  +$httpd = _ask("\n", $httpd, 1, '!');
  +if ($httpd eq '!') {
  + print "Skipping.\n";
  + return;
  +}
   system "$Config{lns} $httpd t/httpd";
   
  -if (lc _ask("Search existing config file for dynamic module dependencies?", 
'n') eq 'y') {
  +# Default: search for dynamic dependencies if mod_so is present, don't bother 
otherwise.
  +my $default = (`t/httpd -l` =~ /mod_so\.c/ ? 'y' : 'n');
  +if (lc _ask("Search existing config file for dynamic module dependencies?", 
$default) eq 'y') {
my %compiled;
for (`t/httpd -V`) {
if (/([\w]+)="(.*)"/) {
  @@ -148,6 +156,8 @@
   
   my @modules   =   grep /^\s*(Add|Load)Module/, @lines;
   my ($server_root) = (map /^\s*ServerRoot\s*(\S+)/, @lines);
  +$server_root =~ s/^"//;
  +$server_root =~ s/"$//;
   
   # Rewrite all modules to load from an absolute path.
   foreach (@modules) {
  @@ -310,6 +320,10 @@
   exit;
   }
   
  +sub have_httpd {
  +return -e 't/httpd';
  +}
  +
   sub run {
   require Test::Harness;
   my $self = shift;
  @@ -514,7 +528,9 @@
*MY::test = sub { Apache::test->MM_test(%params) };
   
# In t/*.t script (or test.pl)
  - (Some methods of Doug's that I haven't reviewed or documented yet)
  + use Apache::test qw(skip_test have_httpd);
  + skip_test unless have_httpd;
  + (Some more methods of Doug's that I haven't reviewed or documented yet)
   
   =head1 DESCRIPTION