cvs commit: modperl Changes

2002-05-29 Thread geoff

geoff   02/05/29 09:56:04

  Modified:.Changes
  Log:
  expand $r->notes('error-notes') to cover PerlRun and RegistryNG
  
  Revision  ChangesPath
  1.647 +2 -1  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.646
  retrieving revision 1.647
  diff -u -r1.646 -r1.647
  --- Changes   29 May 2002 16:25:40 -  1.646
  +++ Changes   29 May 2002 16:56:04 -  1.647
  @@ -14,7 +14,8 @@
   thanks to Lyle Brooks for the spot
   [Stephen Clouse <[EMAIL PROTECTED]>]
   
  -Apache::Registry errors are now saved in $r->notes('error-notes')
  +Apache::Registry/PerlRun/RegistryNG errors are now saved 
  +in $r->notes('error-notes')
   [Jesse Erlbaum <[EMAIL PROTECTED]>]
   
   fix Win32 build problems with spaces in shell arguments
  
  
  



cvs commit: modperl/lib/Apache PerlRun.pm

2002-05-29 Thread geoff

geoff   02/05/29 09:52:17

  Modified:lib/Apache PerlRun.pm
  Log:
  PerlRun/RegistryNG errors are now saved in $r->notes('error-notes')
  Submitted by: geoff
  Reviewed by: dougm
  
  Revision  ChangesPath
  1.39  +9 -2  modperl/lib/Apache/PerlRun.pm
  
  Index: PerlRun.pm
  ===
  RCS file: /home/cvs/modperl/lib/Apache/PerlRun.pm,v
  retrieving revision 1.38
  retrieving revision 1.39
  diff -u -r1.38 -r1.39
  --- PerlRun.pm25 Mar 2002 01:59:02 -  1.38
  +++ PerlRun.pm29 May 2002 16:52:17 -  1.39
  @@ -28,6 +28,12 @@
   return bless {r=>$r}, $class;
   }
   
  +sub xlog_error {
  +my($r, $msg) = @_;
  +$r->log_error($msg);
  +$r->notes('error-notes', $msg);
  +}
  +
   sub can_compile {
   my($pr) = @_;
   my $r = $pr->{r};
  @@ -52,7 +58,7 @@
$pr->{'mtime'} = -M _;
return wantarray ? (OK, $pr->{'mtime'}) : OK;
   }
  -$r->log_error("$filename not found or unable to stat");
  +xlog_error($r, "$filename not found or unable to stat");
   return NOT_FOUND;
   }
   
  @@ -139,7 +145,7 @@
   }
   
   if($errsv) {
  - $r->log_error($errsv);
  + xlog_error($r, $errsv);
return SERVER_ERROR;
   }
   
  @@ -211,6 +217,7 @@
   my $pr = shift;
   if ($@ and substr($@,0,4) ne " at ") {
$pr->{r}->log_error("PerlRun: `$@'");
  + $pr->{r}->notes('error-notes', $@);
$@{$pr->{r}->uri} = $@;
$@ = ''; #XXX fix me, if we don't do this Apache::exit() breaks 
return SERVER_ERROR;
  
  
  



cvs commit: modperl/t/net/perl api.pl

2002-05-29 Thread geoff

geoff   02/05/29 09:26:49

  Modified:t/internal api.t
   t/net/perl api.pl
  Log:
  added tests to check for $r->args(undef) and $r->the_request(undef)
  Submitted by: geoff
  Reviewed by: dougm
  
  Revision  ChangesPath
  1.2   +1 -1  modperl/t/internal/api.t
  
  Index: api.t
  ===
  RCS file: /home/cvs/modperl/t/internal/api.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- api.t 6 Dec 1997 17:57:12 -   1.1
  +++ api.t 29 May 2002 16:26:49 -  1.2
  @@ -1,3 +1,3 @@
   use Apache::test;
   
  -print fetch "http://$net::httpserver$net::perldir/api.pl";;
  +print fetch "http://$net::httpserver$net::perldir/api.pl?arg1=one&arg2=two";;
  
  
  
  1.49  +17 -2 modperl/t/net/perl/api.pl
  
  Index: api.pl
  ===
  RCS file: /home/cvs/modperl/t/net/perl/api.pl,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- api.pl24 Mar 2002 18:22:56 -  1.48
  +++ api.pl29 May 2002 16:26:49 -  1.49
  @@ -16,7 +16,7 @@
   
   my $is_xs = ($r->uri =~ /_xs/);
   
  -my $tests = 75;
  +my $tests = 81;
   my $is_win32 = WIN32;
   $tests += 4 unless $is_win32;
   my $test_get_set = Apache->can('set_handlers') && ($tests += 4);
  @@ -73,9 +73,16 @@
   }
   
   my $the_request = $r->the_request;
  -$r->the_request(join ' ', map { $r->$_() } qw(method uri protocol));
  +my $request_string = $r->method . ' ' .
  + $r->uri. '?' .
  + $r->args   . ' ' .
  + $r->protocol; 
  +$r->the_request($request_string);
   test ++$i, $the_request eq $r->the_request;
   printf "old=$the_request, new=%s\n", $r->the_request;
  +$r->the_request(undef);
  +test ++$i, not $r->the_request;
  +test ++$i, not defined $r->the_request;
   
   my $doc_root = $r->document_root;
   $r->document_root('/tmp');
  @@ -103,6 +110,14 @@
   test ++$i, $r->status_line;
   test ++$i, $r->method eq "GET";
   #test ++$i, $r->method_number
  +
  +# args
  +test ++$i, $r->args eq 'arg1=one&arg2=two';
  +$r->args('foo=bar');
  +test ++$i, $r->args eq 'foo=bar';
  +$r->args(undef);
  +test ++$i, not $r->args;
  +test ++$i, not defined $r->args;
   
   $r->subprocess_env(SetKey => 'value');
   test ++$i, $r->subprocess_env('SetKey') eq 'value';
  
  
  



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

2002-05-29 Thread geoff

geoff   02/05/29 09:25:41

  Modified:.Changes
   src/modules/perl mod_perl_xs.h
  Log:
  fix get_set_PVp() to properly set NULL values when passing in undef
  Submitted by: Stephen Clouse <[EMAIL PROTECTED]>
  Reviewed by: dougm
  
  Revision  ChangesPath
  1.646 +4 -0  modperl/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl/Changes,v
  retrieving revision 1.645
  retrieving revision 1.646
  diff -u -r1.645 -r1.646
  --- Changes   23 May 2002 04:21:06 -  1.645
  +++ Changes   29 May 2002 16:25:40 -  1.646
  @@ -10,6 +10,10 @@
   
   =item 1.26_01-dev
   
  +fix get_set_PVp() to properly set NULL values when passing in undef
  +thanks to Lyle Brooks for the spot
  +[Stephen Clouse <[EMAIL PROTECTED]>]
  +
   Apache::Registry errors are now saved in $r->notes('error-notes')
   [Jesse Erlbaum <[EMAIL PROTECTED]>]
   
  
  
  
  1.7   +1 -1  modperl/src/modules/perl/mod_perl_xs.h
  
  Index: mod_perl_xs.h
  ===
  RCS file: /home/cvs/modperl/src/modules/perl/mod_perl_xs.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- mod_perl_xs.h 2 Mar 2000 23:23:10 -   1.6
  +++ mod_perl_xs.h 29 May 2002 16:25:40 -  1.7
  @@ -3,7 +3,7 @@
   #define get_set_PVp(thing,p) \
   RETVAL = (char*)thing; \
   if(items > 1) \
  -thing = (char*)((ST(1) == &sv_undef) ? NULL : pstrdup(p, SvPV(ST(1),na)))
  +thing = (char*)(SvOK(ST(1)) ? pstrdup(p, SvPV(ST(1),na)) : NULL)
   
   #define get_set_PV(thing) \
   get_set_PVp(thing,r->pool)