Re: modperl 2.0: apache crashes when running modperl script

2003-06-05 Thread arunappa
Stas Bekman [EMAIL PROTECTED] wrote:


'make install' after you have rebuilt mod_perl with MP_DEBUG=1? try to nuke
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache
and 'make install' again.

Actually I know why this happens and why you have the segfault

since you have had:

MP_INST_APACHE2 = 1

it must be installed into 
i686-linux-thread-multi/Apache2/auto/Apache/RequestIO/RequestIO.so

You probably had an older mod_perl install, and now it loads the wrong 
library. I see that you didn't load Apache2 and that explains the problem.

Add to your startup 'use Apache2' as explained here:
http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Configuration


I removed RequestIO.so inside 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache
and did 'make install'. Then added 'use Apache2' in the startup file
and there are no segfaults anymore.

Thanks,

Natarajan Murugaiyan(Ravi)

__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


Re: modperl 2.0: apache crashes when running modperl script

2003-06-04 Thread arunappa

-8-- Start Bug Report 8--
1. Problem Description:

apache crashes when accessing this modperl script:

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile = 'OK';

sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request-content_type('text/html');

  $request-print(END);
HTML
BODY
H1Hello There/H1
/BODY
/HTML
END

return Apache::OK;
}





2. Used Components and their Configuration:

*** using /usr/download/modperl/mod_perl-1.99_09/t/../lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX= /usr/httpd20
  MP_COMPAT_1X= 1
  MP_GENERATE_XS  = 1
  MP_INST_APACHE2 = 1
  MP_LIBNAME  = mod_perl
  MP_USE_DSO  = 1
  MP_USE_STATIC   = 1


*** /usr/httpd20/bin/httpd -V
Server version: Apache/2.0.46
Server built:   Jun  1 2003 19:52:02
Server's Module Magic Number: 20020903:3
Architecture:   32-bit
Server compiled with
 -D APACHE_MPM_DIR=server/mpm/prefork
 -D APR_HAS_SENDFILE
 -D APR_HAS_MMAP
 -D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
 -D APR_USE_SYSVSEM_SERIALIZE
 -D APR_USE_PTHREAD_SERIALIZE
 -D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
 -D APR_HAS_OTHER_CHILD
 -D AP_HAVE_RELIABLE_PIPED_LOGS
 -D HTTPD_ROOT=/usr/httpd20
 -D SUEXEC_BIN=/usr/httpd20/bin/suexec
 -D DEFAULT_PIDLOG=logs/httpd.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_LOCKFILE=logs/accept.lock
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=conf/mime.types
 -D SERVER_CONFIG_FILE=conf/httpd.conf


*** /usr/bin/perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
osname=linux, osvers=2.4.18-11smp, archname=i386-linux-thread-multi
uname='linux daffy.perf.redhat.com 2.4.18-11smp #1 smp thu aug 15 06:41:59 edt 
2002 i686 i686 i386 gnulinux '
config_args='-des -Doptimize=-O2 -march=i386 -mcpu=i686 -Dmyhostname=localhost 
[EMAIL PROTECTED] -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dinstallprefix=/usr -Dprefix=/usr 
-Darchname=i386-linux -Dvendorprefix=/usr -Dsiteprefix=/usr -Duseshrplib -Dusethreads 
-Duseithreads -Duselargefiles -Dd_dosuid -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm 
-Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl -Ubincompat5005 
-Uversiononly -Dpager=/usr/bin/less -isr'
hint=recommended, useposix=true, d_sigaction=define
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing 
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',
optimize='-O2 -march=i386 -mcpu=i686',
cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -I/usr/include/gdbm'
ccversion='', gccversion='3.2 20020822 (Red Hat Linux Rawhide 3.2-5)', 
gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lgdbm -ldb -ldl -lm -lpthread -lc -lcrypt -lutil
perllibs=-lnsl -ldl -lm -lpthread -lc -lcrypt -lutil
libc=/lib/libc-2.2.92.so, so=so, useshrplib=true, libperl=libperl.so
gnulibc_version='2.2.92'
  Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic 
-Wl,-rpath,/usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE'
cccdlflags='-fpic', lddlflags='-shared -L/usr/local/lib'


Characteristics of this binary (from libperl): 
  Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES PERL_IMPLICIT_CONTEXT
  Built under linux
  Compiled at Sep  1 2002 23:56:49
  %ENV:
PERL_LWP_USE_HTTP_10=1
  @INC:
/usr/lib/perl5/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/5.8.0
/usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/site_perl/5.8.0
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
/usr/lib/perl5/vendor_perl/5.8.0
/usr/lib/perl5/vendor_perl
.


3. This is the core dump trace: (if you get a core dump):

I was able to run 'httpd -X' from inside gbd and got a stack trace
with mod_perl compiled with MP_DEBUG=1:

0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 4, wlen=0x4063cb8f) at modperl_filter.c:181
181 *wlen = 0;

#0  0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 4, wlen=0x4063cb8f) at modperl_filter.c:181
#1  0x40640701 in mpxs_Apache__RequestRec_print ()
   from 

Re: modperl 2.0: apache crashes when running modperl script

2003-06-04 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
[...]
3. This is the core dump trace: (if you get a core dump):

I was able to run 'httpd -X' from inside gbd and got a stack trace
with mod_perl compiled with MP_DEBUG=1:
0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 4, wlen=0x4063cb8f) at modperl_filter.c:181
181 *wlen = 0;
#0  0x402f458c in modperl_wbucket_write (my_perl=0x81af228, wb=0x81b3900,
buf=0xb438 4, wlen=0x4063cb8f) at modperl_filter.c:181
#1  0x40640701 in mpxs_Apache__RequestRec_print ()
   from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
#2  0x4063e8c6 in XS_Apache__RequestRec_print ()
   from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
why RequestIO.so doesn't include the debug info? Are you sure you have run 
'make install' after you have rebuilt mod_perl with MP_DEBUG=1? try to nuke
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache
and 'make install' again.

Actually I know why this happens and why you have the segfault

since you have had:

MP_INST_APACHE2 = 1

it must be installed into 
i686-linux-thread-multi/Apache2/auto/Apache/RequestIO/RequestIO.so

You probably had an older mod_perl install, and now it loads the wrong 
library. I see that you didn't load Apache2 and that explains the problem.

Add to your startup 'use Apache2' as explained here:
http://perl.apache.org/docs/2.0/user/intro/start_fast.html#Configuration


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: modperl 2.0: apache crashes when running modperl script

2003-06-03 Thread arunappa
-8-- Start Bug Report 8--
1. Problem Description:

apache crashes when accessing this modperl script:

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile = 'OK';

sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request-content_type('text/html');

  $request-print(END);
HTML
BODY
H1Hello There/H1
/BODY
/HTML
END

return Apache::OK;
}

2. Used Components and their Configuration:

*** using /usr/download/modperl/mod_perl-1.99_09/t/../lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX= /usr/httpd20
  MP_COMPAT_1X= 1
  MP_GENERATE_XS  = 1
  MP_INST_APACHE2 = 1
  MP_LIBNAME  = mod_perl
  MP_USE_DSO  = 1
  MP_USE_STATIC   = 1


__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


Re: modperl 2.0: apache crashes when running modperl script

2003-06-03 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
-8-- Start Bug Report 8--
1. Problem Description:
apache crashes when accessing this modperl script:

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
use Apache::Const -compile = 'OK';
sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request-content_type('text/html');
  $request-print(END);
HTML
BODY
H1Hello There/H1
/BODY
/HTML
END
return Apache::OK;
}
2. Used Components and their Configuration:

*** using /usr/download/modperl/mod_perl-1.99_09/t/../lib/Apache/BuildConfig.pm
*** Makefile.PL options:
  MP_AP_PREFIX= /usr/httpd20
  MP_COMPAT_1X= 1
  MP_GENERATE_XS  = 1
  MP_INST_APACHE2 = 1
  MP_LIBNAME  = mod_perl
  MP_USE_DSO  = 1
  MP_USE_STATIC   = 1
that's only a beginning of the report. Where is the rest? Why is it so hard to 
copy-n-paste the report? OK, I'll do that for you.

 3. This is the core dump trace: (if you get a core dump):

 Apache crashes but does not dump core. I set unlimit to unlimited,
 made sure the filesystem from which 'httpd -X' is run has enough free space.
 Still no core. Could not find Bad::Segv module either in modperl or in
 CPAN and therefore could not try to dump using a script like core_dump.pl
 mentioned in 'Debugging mod_perl C Internals' document.
Yeah, I need to update the Bad::Segv part. It's called Debug::DumpCore.

 I was able to run 'httpd -X' from inside gbd and got a stack trace:

 (gdb) bt
 #0  0x402f1f47 in modperl_wbucket_write ()
from /usr/httpd20/modules/mod_perl.so
 #1  0x40638701 in mpxs_Apache__RequestRec_print ()
from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
 #2  0x406368c6 in XS_Apache__RequestRec_print ()
from 
/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi/auto/Apache/RequestIO/RequestIO.so
 #3  0x403868c5 in Perl_pp_entersub ()
from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
 #4  0x4037f059 in Perl_runops_standard ()
from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
 #5  0x40327139 in S_call_body ()
from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
 #6  0x40326eb6 in Perl_call_sv ()
from /usr/lib/perl5/5.8.0/i386-linux-thread-multi/CORE/libperl.so
 #7  0x402ed4e2 in modperl_callback () from /usr/httpd20/modules/mod_perl.so
 #8  0x402ed9e4 in modperl_callback_run_handlers ()
from /usr/httpd20/modules/mod_perl.so
 #9  0x402edc25 in modperl_callback_per_dir ()
from /usr/httpd20/modules/mod_perl.so
 #10 0x402e9105 in modperl_response_handler_run ()
from /usr/httpd20/modules/mod_perl.so
 #11 0x402e9325 in modperl_response_handler_cgi ()
from /usr/httpd20/modules/mod_perl.so
 #12 0x0807b67e in ap_run_handler (r=0x81a9268) at config.c:195
 #13 0x0807bb96 in ap_invoke_handler (r=0x81a9268) at config.c:401
 #14 0x0806baab in ap_process_request (r=0x81a9268) at http_request.c:288
 #15 0x08067ce9 in ap_process_http_connection (c=0x816d458) at http_core.c:293
 #16 0x08084476 in ap_run_process_connection (c=0x816d458) at connection.c:85
 #17 0x0807a234 in child_main (child_num_arg=1080249231) at prefork.c:696
 #18 0x0807a3de in make_child (s=0x80b6178, slot=0) at prefork.c:736
 #19 0x0807a437 in startup_children (number_to_start=5) at prefork.c:808
 #20 0x0807ab29 in ap_mpm_run (_pconf=0x8079b10, plog=0x80ebb50, s=0x80b6178)
 at prefork.c:1024
 #21 0x0807f842 in main (argc=2, argv=0xba74) at main.c:660
 #22 0x420158d4 in __libc_start_main () from /lib/i686/libc.so.6

The problem with this trace is that it doesn't show the arguments. You need to 
build mod_perl with MP_DEBUG=1 and generate it again.

__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread arunappa


I get an Internal Server Error in the browser when trying
to access the URI /hello. 

Apache and modperl version:
Sun Jun 01 18:51:42 2003] [notice] Apache/2.0.46 (Unix) mod_perl/1.99_09 Perl/v5.8.0 
mod_ssl/2.0.46 OpenSSL/0.9.6b configured -- resuming normal operations

Relvant contents of perl.conf file:
PerlRequire /home/ravi/www/apache/modperl/startup.pl
Location /hello
SetHandler perl-script
PerlHandler Apache::hello
/Location

Contents of /home/ravi/www/apache/modperl/startup.pl:
use lib /home2/apache/www/html/modperl2/book/lincoln;
1;

Script hello.pm located at /home2/apache/www/html/modperl2/book/lincoln/Apache/hello.pm

Contents of hello.pm:
package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();

sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request-content_type('text/html');

  $request-print(END);   # what does the ) do in print?
HTML
BODY
H1Hello There/H1
/BODY
/HTML
END

return Apache::OK;
}

1;

Relevant httpd error_log:
[Sun Jun 01 19:04:46 2003] [notice] child pid 2861 exit signal Segmentation fault (11)

Relevant http access_log:
127.0.0.1 - - [01/Jun/2003:19:04:46 -0400] GET /hello HTTP/1.1 500 670


I am not sure if the problem is with apache or modperl.
I could not find a core file under httpd ServerRoot.

Natarajan Murugaiyan(Ravi)



__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread Stas Bekman
[EMAIL PROTECTED] wrote:
I get an Internal Server Error in the browser when trying
to access the URI /hello. 

Apache and modperl version:
Sun Jun 01 18:51:42 2003] [notice] Apache/2.0.46 (Unix) mod_perl/1.99_09 Perl/v5.8.0 
mod_ssl/2.0.46 OpenSSL/0.9.6b configured -- resuming normal operations
When submitting bug reports, please follow these guidelines:
http://perl.apache.org/docs/2.0/user/help/help.html#Reporting_Problems
[...]

package Apache::hello;

use strict;

use Apache::RequestRec ();
use Apache::RequestIO ();
sub handler {
  my $request = shift;  # what does shift operate on @_?
  $request-content_type('text/html');
  $request-print(END);   # what does the ) do in print?
HTML
BODY
H1Hello There/H1
/BODY
/HTML
END
return Apache::OK;
}
Where did you take this example from? you should return a constant Apache::OK, 
not a string Apache::OK. You need to import this constant before you can use 
it. Here is a skeleton:

use Apache::Const -compile = 'OK';

sub handler {
  ...
  return Apache::OK;
}
1;

Relevant httpd error_log:
[Sun Jun 01 19:04:46 2003] [notice] child pid 2861 exit signal Segmentation fault (11)
Relevant http access_log:
127.0.0.1 - - [01/Jun/2003:19:04:46 -0400] GET /hello HTTP/1.1 500 670
I am not sure if the problem is with apache or modperl.
I could not find a core file under httpd ServerRoot.
Take a look at:
http://perl.apache.org/docs/2.0/devel/debug/c.html#Getting_the_core_File_Dumped
__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread Ged Haywood
Hi guys,

On Mon, 2 Jun 2003, Stas Bekman wrote:

  Sun Jun 01 18:51:42 2003] [notice] Apache/2.0.46 (Unix)
  mod_perl/1.99_09 Perl/v5.8.0 mod_ssl/2.0.46 OpenSSL/0.9.6b

http://www.openssl.org/news/secadv_20030219.txt

73,
Ged.




Re: modperl 2.0: apache crashes when running modperl script

2003-06-02 Thread arunappa


__
McAfee VirusScan Online from the Netscape Network.
Comprehensive protection for your entire computer. Get your free trial today!
http://channels.netscape.com/ns/computing/mcafee/index.jsp?promo=393397

Get AOL Instant Messenger 5.1 free of charge.  Download Now!
http://aim.aol.com/aimnew/Aim/register.adp?promo=380455


bug.rpt
Description: bug.rpt


cvs commit: modperl-2.0/lib/ModPerl BuildOptions.pm

2003-02-20 Thread randyk
randyk  2003/02/19 21:19:14

  Modified:lib/ModPerl BuildOptions.pm
  Log:
  Reviewed by: stas
  
  Revision  ChangesPath
  1.17  +7 -0  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.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- BuildOptions.pm   21 May 2002 16:48:29 -  1.16
  +++ BuildOptions.pm   20 Feb 2003 05:19:14 -  1.17
  @@ -3,6 +3,7 @@
   use strict;
   use warnings;
   
  +use Apache::Build ();
   my $param_qr = qr([\s=]+);
   
   use constant VERBOSE = 1;
  @@ -66,6 +67,12 @@
   if($key eq 'MP_APXS') {
   $val = File::Spec-canonpath(File::Spec-rel2abs($val));
   }
  +
  + # MP_AP_PREFIX may not contain spaces
  + if ($key eq 'MP_AP_PREFIX'  Apache::Build::WIN32()) {
  +require Win32;
  + $val = Win32::GetShortPathName($val);
  + }
   
   if ($self-{$key}) {
   $self-{$key} .= ' ';
  
  
  



cvs commit: modperl-2.0/t/response/TestCompat conn_authen.pm

2003-02-19 Thread geoff
geoff   2003/02/19 06:14:36

  Modified:.Changes
   lib/Apache compat.pm
   t/response/TestCompat conn_authen.pm
  Log:
  fixes to Apache::compat. make $r-connection-auth_type interface
  with r-ap_auth_type. make both $r-connection-auth_type and
  $r-connection-user writable
  Submitted by: geoff
  Reviewed by:  stas
  
  Revision  ChangesPath
  1.129 +4 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.128
  retrieving revision 1.129
  diff -u -r1.128 -r1.129
  --- Changes   19 Feb 2003 14:12:01 -  1.128
  +++ Changes   19 Feb 2003 14:14:35 -  1.129
  @@ -10,6 +10,10 @@
   
   =item 1.99_09-dev
   
  +fixes to Apache::compat. make $r-connection-auth_type interface
  +with r-ap_auth_type. make both $r-connection-auth_type and
  +$r-connection-user writable. [Geoffrey Young]
  +
   Open up r-ap_auth_type, making it possible to write custom
   authen handlers that don't rely on Basic authentication or
   it's associated ap_* functions.
  
  
  
  1.80  +2 -2  modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- compat.pm 17 Feb 2003 09:47:31 -  1.79
  +++ compat.pm 19 Feb 2003 14:14:36 -  1.80
  @@ -538,8 +538,8 @@
   
   # auth_type and user records don't exist in 2.0 conn_rec struct
   # 'PerlOptions +GlobalRequest' is required
  -sub auth_type { Apache-request-auth_type }
  -sub user  { Apache-request-user  }
  +sub auth_type { shift; Apache-request-ap_auth_type(@_) }
  +sub user  { shift; Apache-request-user(@_)  }
   
   1;
   __END__
  
  
  
  1.2   +33 -5 modperl-2.0/t/response/TestCompat/conn_authen.pm
  
  Index: conn_authen.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/conn_authen.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- conn_authen.pm12 Feb 2003 23:42:23 -  1.1
  +++ conn_authen.pm19 Feb 2003 14:14:36 -  1.2
  @@ -1,6 +1,6 @@
   package TestCompat::conn_authen;
   
  -# simply check that we can retrieve:
  +# compat checks for
   #   $r-connection-auth_type
   #   $r-connection-user
   # both records don't exist in 2.0 conn_rec and therefore require
  @@ -16,19 +16,47 @@
   use Apache::Constants qw(OK REMOTE_HOST);
   
   sub handler {
  +
   my $r = shift;
   
  +my $req_auth_type = $r-connection-auth_type || '';
  +
  +die request auth_type is '$req_auth_type', should be empty
  +if $req_auth_type;
  +
  +# get_basic_auth_pw populates $r-user and $r-ap_auth_type
   my($rc, $sent_pw) = $r-get_basic_auth_pw;
   
   return $rc if $rc != Apache::OK;
   
  -my $auth_type = $r-connection-auth_type || '';
  -die auth_type is '$auth_type', should be 'Basic' 
  -unless $auth_type eq 'Basic';
  +$req_auth_type = $r-connection-auth_type || '';
  +
  +die request auth_type is '$req_auth_type', should be 'Basic'
  +unless $req_auth_type eq 'Basic';
  +
  +my $config_auth_type = $r-auth_type || '';
  +
  +die httpd.conf auth_type is '$config_auth_type', should be 'Basic'
  +unless $config_auth_type eq 'Basic';
   
   my $user = $r-connection-user || '';
  -die user is '$user', while expecting 'dougm'
  +
  +die user is '$user', should be 'dougm'
   unless $user eq 'dougm';
  +
  +# make sure we can set both
  +$r-connection-auth_type('sailboat');
  +$r-connection-user('geoff');
  +
  +$user = $r-connection-user || '';
  +
  +die user is '$user', should be 'geoff'
  +unless $user eq 'geoff';
  +
  +$req_auth_type = $r-connection-auth_type || '';
  +
  +die request auth_type is '$req_auth_type', should be 'sailboat'
  +unless $req_auth_type eq 'sailboat';
   
   OK;
   }
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-02-19 Thread stas
stas2003/02/19 15:55:23

  Modified:.Changes
   lib/Apache compat.pm
   t/response/TestCompat apache.pm
   xs/Apache/Response Apache__Response.h
   xs/maps  modperl_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  move $r-send_http_header implementation to Apache::compat.  This
  allows the 1.0 code to run unmodified if $r-send_http_header is
  called before the response change. we already handle the check whether
  content_type was set, when deciding whether the headers are to be
  parsed inside modperl_wbucket_pass().
  
  Revision  ChangesPath
  1.130 +6 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.129
  retrieving revision 1.130
  diff -u -r1.129 -r1.130
  --- Changes   19 Feb 2003 14:14:35 -  1.129
  +++ Changes   19 Feb 2003 23:55:22 -  1.130
  @@ -10,6 +10,12 @@
   
   =item 1.99_09-dev
   
  +move $r-send_http_header implementation to Apache::compat.  This
  +allows the 1.0 code to run unmodified if $r-send_http_header is
  +called before the response change. we already handle the check whether
  +content_type was set, when deciding whether the headers are to be
  +parsed inside modperl_wbucket_pass(). [Stas]
  +
   fixes to Apache::compat. make $r-connection-auth_type interface
   with r-ap_auth_type. make both $r-connection-auth_type and
   $r-connection-user writable. [Geoffrey Young]
  
  
  
  1.81  +5 -0  modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.80
  retrieving revision 1.81
  diff -u -r1.80 -r1.81
  --- compat.pm 19 Feb 2003 14:14:36 -  1.80
  +++ compat.pm 19 Feb 2003 23:55:23 -  1.81
  @@ -154,6 +154,11 @@
   return Apache::current_callback();
   }
   
  +sub send_http_header {
  +my ($r, $type) = @_;
  +$r-content_type($type) if defined $type;
  +}
  +
   #to support $r-server_root_relative
   *server_root_relative = \Apache::server_root_relative;
   
  
  
  
  1.5   +3 -0  modperl-2.0/t/response/TestCompat/apache.pm
  
  Index: apache.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestCompat/apache.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- apache.pm 17 Feb 2003 09:03:17 -  1.4
  +++ apache.pm 19 Feb 2003 23:55:23 -  1.5
  @@ -55,3 +55,6 @@
   
   1;
   
  +__END__
  +# so we can test whether send_httpd_header() works fine
  +PerlOptions +ParseHeaders
  
  
  
  1.9   +0 -22 modperl-2.0/xs/Apache/Response/Apache__Response.h
  
  Index: Apache__Response.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Response/Apache__Response.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Apache__Response.h17 Jan 2003 02:26:31 -  1.8
  +++ Apache__Response.h19 Feb 2003 23:55:23 -  1.9
  @@ -13,28 +13,6 @@
   rcfg-wbucket-header_parse = 0; \
   }
   
  -/* XXX: should only be part of Apache::compat */
  -static MP_INLINE void
  -mpxs_Apache__RequestRec_send_http_header(pTHX_ request_rec *r,
  - const char *type)
  -{
  -MP_dRCFG;
  -
  -if (type) {
  -ap_set_content_type(r, apr_pstrdup(r-pool, type));
  -}
  -
  -if (rcfg-wbucket) {
  -/* turn off PerlOptions +ParseHeaders */
  -rcfg-wbucket-header_parse = 0; 
  -}
  -else {
  -/* the response is not initialized yet */
  -Perl_croak(aTHX_ send_http_header() can't be called before 
  -   the response phase);
  -}
  -}
  -
   static MP_INLINE void
   mpxs_Apache__RequestRec_set_last_modified(request_rec *r, apr_time_t mtime)
   {
  
  
  
  1.54  +0 -1  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.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- modperl_functions.map 17 Feb 2003 09:03:17 -  1.53
  +++ modperl_functions.map 19 Feb 2003 23:55:23 -  1.54
  @@ -56,7 +56,6 @@
   
   MODULE=Apache::Response   PACKAGE=Apache::RequestRec
   DEFINE_send_cgi_header | | request_rec *:r, SV *:buffer
  - mpxs_Apache__RequestRec_send_http_header | | r, type=NULL
mpxs_Apache__RequestRec_set_last_modified | | r, mtime=0
   
   
  
  
  
  1.105 +0 -18 modperl-2.0/xs/tables/current/ModPerl/FunctionTable.pm
  
  Index: FunctionTable.pm

cvs commit: modperl-2.0 STATUS

2003-02-19 Thread stas
stas2003/02/19 16:41:51

  Modified:.STATUS
  Log:
  need to resolve the issue with END blocks
  
  Revision  ChangesPath
  1.34  +5 -1  modperl-2.0/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/modperl-2.0/STATUS,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- STATUS15 Jan 2003 05:22:53 -  1.33
  +++ STATUS20 Feb 2003 00:41:51 -  1.34
  @@ -50,6 +50,10 @@
   Needs Patch or Further Investigation:
   -
   
  +* child processes never run END blocks. a good example is
  +  Apache::TestUtil, which doesn't cleanup files and dirs it has
  +  created, because the END block is not run.
  +
   * Currently modperl_filter_add_{connection|request} check the filter
 handler function attrs before accepting the filter. If the module
 wasn't preloaded the check fails and filter handler is skipped. We
  
  
  



cvs commit: modperl-2.0 Changes

2003-02-19 Thread stas
stas2003/02/19 17:28:25

  Modified:t/response/TestAPI uri.pm
   xs/APR/URI APR__URI.h
   .Changes
  Log:
  fix a bug for apr  0.9.3, where it segfaults in apr_uri_unparse, if
  hostname is set, but not the scheme.
  
  Revision  ChangesPath
  1.9   +13 -1 modperl-2.0/t/response/TestAPI/uri.pm
  
  Index: uri.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/uri.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- uri.pm14 May 2002 01:32:50 -  1.8
  +++ uri.pm20 Feb 2003 01:28:24 -  1.9
  @@ -4,6 +4,7 @@
   use warnings FATAL = 'all';
   
   use Apache::Test;
  +use Apache::TestUtil;
   
   use APR::URI ();
   use Apache::URI ();
  @@ -17,7 +18,7 @@
   sub handler {
   my $r = shift;
   
  -plan $r, tests = 14;
  +plan $r, tests = 15;
   
   $r-args('query');
   
  @@ -49,6 +50,17 @@
   $parsed-path($path);
   
   ok $parsed-path eq $path;
  +
  +{
  +# test the segfault in apr  0.9.3 (fixed on mod_perl side)
  +# passing only the /path
  +my $parsed = APR::URI-parse($r-pool, $r-uri);
  +# set hostname, but not the scheme
  +$parsed-hostname($r-get_server_name);
  +$parsed-port($r-get_server_port);
  +#$parsed-scheme('http'); 
  +ok t_cmp($r-construct_url, $parsed-unparse);
  +}
   
   my $newr = Apache::RequestRec-new($r-connection, $r-pool);
   my $url_string = $path?query;
  
  
  
  1.5   +9 -0  modperl-2.0/xs/APR/URI/APR__URI.h
  
  Index: APR__URI.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/URI/APR__URI.h,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- APR__URI.h14 May 2002 01:32:50 -  1.4
  +++ APR__URI.h20 Feb 2003 01:28:24 -  1.5
  @@ -3,6 +3,15 @@
  apr_uri_t *uptr,
  unsigned flags)
   {
  +
  +/* XXX: check that my patch was actually applied in apr v9.3 */
  +#if APR_MINOR_VERSION == 9  APR_PATCH_VERSION  3
  +/* apr  0.9.3 segfaults if hostname is set, but scheme is not */
  +if (uptr-hostname  !uptr-scheme) {
  +uptr-scheme = http;
  +}
  +#endif
  +
   return apr_uri_unparse(((modperl_uri_t *)uptr)-pool,
  uptr, flags);
   }
  
  
  
  1.131 +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.130
  retrieving revision 1.131
  diff -u -r1.130 -r1.131
  --- Changes   19 Feb 2003 23:55:22 -  1.130
  +++ Changes   20 Feb 2003 01:28:25 -  1.131
  @@ -10,6 +10,9 @@
   
   =item 1.99_09-dev
   
  +fix a bug for apr  0.9.3, where it segfaults in apr_uri_unparse, if
  +hostname is set, but not the scheme. [Stas]
  +
   move $r-send_http_header implementation to Apache::compat.  This
   allows the 1.0 code to run unmodified if $r-send_http_header is
   called before the response change. we already handle the check whether
  
  
  



cvs commit: modperl-2.0/lib/Bundle - New directory

2003-02-18 Thread stas
stas2003/02/18 16:32:14

  modperl-2.0/lib/Bundle - New directory



cvs commit: modperl-2.0 Changes

2003-02-18 Thread stas
stas2003/02/18 16:32:45

  Modified:.Changes
  Added:   lib/Bundle Apache2.pm
  Log:
  add Apache::Bundle2
  
  Revision  ChangesPath
  1.1  modperl-2.0/lib/Bundle/Apache2.pm
  
  Index: Apache2.pm
  ===
  package Bundle::Apache2;
  
  $VERSION = '1.00';
  
  1;
  
  __END__
  
  =head1 NAME
  
  Bundle::Apache2 - Install Apache mod_perl2 and related modules
  
  =head1 SYNOPSIS
  
  Cperl -MCPAN -e 'install Bundle::Apache2'
  
  =head1 CONTENTS
  
  LWP   - Used in testing
  
  Chatbot::Eliza- Used in testing
  
  Devel::Symdump- Symbol table browsing with Apache::Status
  
  CGI   - Used in testing (it's in core, but some vendors exclude it)
  
  =head1 DESCRIPTION
  
  This bundle contains modules used by Apache mod_perl2.
  
  Asking CPAN.pm to install a bundle means to install the bundle itself
  along with all the modules contained in the CONTENTS section
  above. Modules that are up to date are not installed, of course.
  
  =head1 AUTHOR
  
  Doug MacEachern, Stas Bekman
  
  
  
  1.127 +2 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.126
  retrieving revision 1.127
  diff -u -r1.126 -r1.127
  --- Changes   17 Feb 2003 09:39:54 -  1.126
  +++ Changes   19 Feb 2003 00:32:45 -  1.127
  @@ -10,6 +10,8 @@
   
   =item 1.99_09-dev
   
  +add Apache::Bundle2 [Stas]
  +
   Apache::Reload now supports the PerlPreConnectionHandler invocation
   mode, so connection filter and protocol modules can be automatically
   reloaded on change. [Stas]
  
  
  



cvs commit: modperl-2.0/todo api.txt

2003-02-18 Thread stas
stas2003/02/18 20:07:17

  Modified:todo api.txt
  Log:
  $uri-rpath is missing from APR::URI
  
  Revision  ChangesPath
  1.33  +3 -0  modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- api.txt   17 Feb 2003 09:03:17 -  1.32
  +++ api.txt   19 Feb 2003 04:07:17 -  1.33
  @@ -28,6 +28,9 @@
   needs to default to current pool (pconf at startup, r-pool at request
   time)
   
  +APR::URI
  +missing $uri-rpath
  +
   Apache::Util::*
   escape_path() - (was escape_uri) can be changed in apache not to require a
   pool
  
  
  



cvs commit: modperl-2.0/xs/maps modperl_functions.map

2003-02-17 Thread stas
stas2003/02/17 01:03:17

  Modified:.Changes
   lib/Apache compat.pm
   src/modules/perl modperl_callback.c modperl_callback.h
modperl_handler.c
   t/htdocs .cvsignore
   t/modperl .cvsignore
   t/response/TestCompat apache.pm
   todo api.txt
   xs/ModPerl/Util ModPerl__Util.h
   xs/maps  modperl_functions.map
  Added:   t/response/TestModperl current_callback.pm
  Log:
  - implement Apache::current_callback
  - $r-current_callback goes into Apache::compat, since now we have a way
too many callbacks unrelated to $r
  - add some tests
  
  Revision  ChangesPath
  1.125 +4 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.124
  retrieving revision 1.125
  diff -u -r1.124 -r1.125
  --- Changes   12 Feb 2003 23:42:23 -  1.124
  +++ Changes   17 Feb 2003 09:03:16 -  1.125
  @@ -10,6 +10,10 @@
   
   =item 1.99_09-dev
   
  +implement Apache::current_callback + $r-current_callback goes into
  +Apache::compat, since now we have a way too many callbacks unrelated
  +to $r [Stas]
  +
   Add Apache::compat methods: $r-connection-auth_type and
   $r-connection-user (requires 'PerlOptions +GlobalRequest') + tests
   [Stas]
  
  
  
  1.78  +4 -0  modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.77
  retrieving revision 1.78
  diff -u -r1.77 -r1.78
  --- compat.pm 12 Feb 2003 23:42:23 -  1.77
  +++ compat.pm 17 Feb 2003 09:03:16 -  1.78
  @@ -125,6 +125,10 @@
   die $err if $err;
   }
   
  +sub current_callback {
  +return Apache::current_callback();
  +}
  +
   package Apache::Constants;
   
   use Apache::Const ();
  
  
  
  1.54  +2 -0  modperl-2.0/src/modules/perl/modperl_callback.c
  
  Index: modperl_callback.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- modperl_callback.c29 Jan 2003 01:04:33 -  1.53
  +++ modperl_callback.c17 Feb 2003 09:03:16 -  1.54
  @@ -172,6 +172,8 @@
   break;
   };
   
  +modperl_callback_current_callback_set(desc);
  +
   /* XXX: deal with {push,set}_handler of the phase we're currently in */
   /* for now avoid the segfault by not letting av-nelts grow if
* somebody push_handlers to the phase we are currently in, but
  
  
  
  1.22  +9 -0  modperl-2.0/src/modules/perl/modperl_callback.h
  
  Index: modperl_callback.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- modperl_callback.h21 Feb 2002 01:45:34 -  1.21
  +++ modperl_callback.h17 Feb 2003 09:03:16 -  1.22
  @@ -10,6 +10,15 @@
   #define ap_hook_fixup  ap_hook_fixups
   #define ap_hook_logap_hook_log_transaction
   
  +#define modperl_callback_current_callback_sv \
  +get_sv(Apache::__CurrentCallback, TRUE)
  +
  +#define modperl_callback_current_callback_set(desc) \
  +sv_setpv(modperl_callback_current_callback_sv, desc)
  +
  +#define modperl_callback_current_callback_get() \
  +SvPVX(modperl_callback_current_callback_sv)
  +
   int modperl_callback(pTHX_ modperl_handler_t *handler, apr_pool_t *p,
request_rec *r, server_rec *s, AV *args);
   
  
  
  
  1.16  +1 -1  modperl-2.0/src/modules/perl/modperl_handler.c
  
  Index: modperl_handler.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_handler.c,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- modperl_handler.c 1 Jan 2003 03:45:54 -   1.15
  +++ modperl_handler.c 17 Feb 2003 09:03:16 -  1.16
  @@ -175,7 +175,7 @@
   }
   
   #define set_desc(dtype) \
  -MP_TRACE_a_do(if (desc) *desc = modperl_handler_desc_##dtype(idx))
  +if (desc) *desc = modperl_handler_desc_##dtype(idx)
   
   #define check_modify(dtype) \
   if ((action  MP_HANDLER_ACTION_GET)  rcfg) { \
  
  
  
  1.2   +1 -0  modperl-2.0/t/htdocs/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/htdocs/.cvsignore,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- .cvsignore26 Feb 2002 19:09:10 -  1.1
  +++ .cvsignore17

cvs commit: modperl-2.0/xs/maps apache_functions.map

2003-02-17 Thread stas
stas2003/02/17 01:49:05

  Modified:xs/maps  apache_functions.map
  Log:
  by removing previous section (with functions that have moved elsewhere),
  the 'guess' functionality went broken. Correct by adding an explicit
  MODULE declaration.
  
  Revision  ChangesPath
  1.62  +1 -1  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.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- apache_functions.map  24 Jan 2003 07:39:29 -  1.61
  +++ apache_functions.map  17 Feb 2003 09:49:05 -  1.62
  @@ -211,7 +211,7 @@
ap_walk_config
   ap_process_config_tree
   
  -PACKAGE=guess
  +MODULE=Apache::Filter PACKAGE=guess
   ~ap_add_output_filter
   ~ap_add_input_filter
   -ap_add_input_filter_handle
  
  
  



cvs commit: modperl-2.0/lib/Apache Reload.pm

2003-02-16 Thread stas
stas2003/02/16 16:54:49

  Modified:lib/Apache Reload.pm
  Log:
  - get rid of dependency on mod_perl 1.0 (Apache-gensym)
  - require 1.99
  
  Revision  ChangesPath
  1.6   +4 -3  modperl-2.0/lib/Apache/Reload.pm
  
  Index: Reload.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Reload.pm,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Reload.pm 29 Nov 2002 05:36:56 -  1.5
  +++ Reload.pm 17 Feb 2003 00:54:49 -  1.6
  @@ -3,6 +3,8 @@
   use strict;
   use warnings FATAL = 'all';
   
  +use mod_perl 1.99;
  +
   our $VERSION = '0.08';
   
   require Apache::RequestUtil;
  @@ -60,9 +62,8 @@
   my $touch_mtime = (stat($TouchFile))[9] || return 1;
   return 1 unless $touch_mtime  $TouchTime;
   $TouchTime = $touch_mtime;
  -my $sym = Apache-gensym;
  -open($sym, $TouchFile) || die Can't open '$TouchFile': $!;
  -$TouchModules = $sym;
  +open my $fh, $TouchFile or die Can't open '$TouchFile': $!;
  +$TouchModules = $fh;
   chomp $TouchModules;
   }
   
  
  
  



Re: cvs commit: modperl-2.0 Changes

2003-02-13 Thread Geoffrey Young


  +package Apache::Connection;
  +
  +# auth_type and user records don't exist in 2.0 conn_rec struct
  +# 'PerlOptions +GlobalRequest' is required
  +sub auth_type { Apache-request-auth_type }
  +sub user  { Apache-request-user  }
  +
   1;
   __END__
  

I think this may need a bit more thought (or at least more explanation).

in 1.0 there is both $r-auth_type and $c-auth_type, and they have 
different meanings.

$r-auth_type represents the AuthType from the config (via 
r-per_dir_config).  when you get $r-auth_type, you're asking what kind of 
authentication is configured for the request.

$c-auth_type is populated by authen handlers, after the user has been 
authenticated, with whatever authentication method was used.  I'm not sure 
about the history of this, but I suppose in theory it is possible for a 
client to request Digest auth, but the server fall back to Basic.

at any rate, I don't know how the current 2.0 or 2.1 aaa stuff handles this 
difference, if at all, but we (well, I :) need to be clear on how that works 
before agreeing that $r-connection-auth_type in Apache::Compat is the same 
as $r-auth_type.

--Geoff





cvs commit: modperl-2.0 Changes

2003-02-12 Thread stas
stas2003/02/12 15:42:23

  Modified:lib/Apache compat.pm
   .Changes
  Added:   t/compat conn_authen.t
   t/response/TestCompat conn_authen.pm
  Log:
  Add Apache::compat methods: $r-connection-auth_type and
  $r-connection-user (requires 'PerlOptions +GlobalRequest') + tests
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/compat/conn_authen.t
  
  Index: conn_authen.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  plan tests = 1, \have_lwp;
  
  my $location = /TestCompat::conn_authen;
  
  ok GET_OK $location, username = 'dougm', password = 'foo';
  
  
  
  
  1.1  modperl-2.0/t/response/TestCompat/conn_authen.pm
  
  Index: conn_authen.pm
  ===
  package TestCompat::conn_authen;
  
  # simply check that we can retrieve:
  #   $r-connection-auth_type
  #   $r-connection-user
  # both records don't exist in 2.0 conn_rec and therefore require
  # 'PerlOptions +GlobalRequest' to retrieve those via Apache-request
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::TestUtil;
  use Apache::Test;
  
  use Apache::compat ();
  use Apache::Constants qw(OK REMOTE_HOST);
  
  sub handler {
  my $r = shift;
  
  my($rc, $sent_pw) = $r-get_basic_auth_pw;
  
  return $rc if $rc != Apache::OK;
  
  my $auth_type = $r-connection-auth_type || '';
  die auth_type is '$auth_type', should be 'Basic' 
  unless $auth_type eq 'Basic';
  
  my $user = $r-connection-user || '';
  die user is '$user', while expecting 'dougm'
  unless $user eq 'dougm';
  
  OK;
  }
  
  1;
  
  __DATA__
  require valid-user
  AuthType Basic
  AuthName simple
  SetHandler modperl
  PerlOptions +GlobalRequest
  PerlAuthenHandler TestCompat::conn_authen
  PerlResponseHandler Apache::TestHandler::ok1
  
  
  
  
  1.77  +7 -0  modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.76
  retrieving revision 1.77
  diff -u -r1.76 -r1.77
  --- compat.pm 31 Jan 2003 04:37:06 -  1.76
  +++ compat.pm 12 Feb 2003 23:42:23 -  1.77
  @@ -530,5 +530,12 @@
   return Apache::DECLINED;
   }
   
  +package Apache::Connection;
  +
  +# auth_type and user records don't exist in 2.0 conn_rec struct
  +# 'PerlOptions +GlobalRequest' is required
  +sub auth_type { Apache-request-auth_type }
  +sub user  { Apache-request-user  }
  +
   1;
   __END__
  
  
  
  1.124 +4 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.123
  retrieving revision 1.124
  diff -u -r1.123 -r1.124
  --- Changes   7 Feb 2003 02:58:30 -   1.123
  +++ Changes   12 Feb 2003 23:42:23 -  1.124
  @@ -10,6 +10,10 @@
   
   =item 1.99_09-dev
   
  +Add Apache::compat methods: $r-connection-auth_type and
  +$r-connection-user (requires 'PerlOptions +GlobalRequest') + tests
  +[Stas]
  +
   Several issues resolved with parsing headers, including making work
   the handlers calling $r-content_type() and not sending raw headers,
   when the headers scanning is turned on. Lots of tests added to
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_filter.c

2003-02-07 Thread stas
stas2003/02/07 20:36:35

  Modified:src/modules/perl modperl_filter.c
  Log:
  use a faster way to check whether we need to use a truncated buffer,
  strlen on an 8k buffer is not cool.
  
  Revision  ChangesPath
  1.52  +2 -1  modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- modperl_filter.c  7 Feb 2003 02:49:01 -   1.51
  +++ modperl_filter.c  8 Feb 2003 04:36:35 -   1.52
  @@ -25,7 +25,8 @@
* XXX: if buf wasn't 'const char *buf' we could simply do
* buf[len] = '\0'
*/
  -if (len  strlen(buf)) {
  +/* MP_IOBUFSIZE is the size of wb-outbuf */
  +if (buf == wb-outbuf  len  MP_IOBUFSIZE) {
   work_buf = (char *)apr_pcalloc(wb-pool, sizeof(char*)*len);
   memcpy((void*)work_buf, buf, len);
   }
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in

2003-02-06 Thread stas
stas2003/02/06 15:57:08

  Modified:ModPerl-Registry/t/conf extra.conf.in
  Log:
  add ScriptAlias so we can do tests against mod_cgi
  
  Revision  ChangesPath
  1.9   +2 -0  modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- extra.conf.in 24 Dec 2002 01:51:40 -  1.8
  +++ extra.conf.in 6 Feb 2003 23:57:08 -   1.9
  @@ -35,6 +35,8 @@
   Alias /registry_oo_conf/ @ServerRoot@/cgi-bin/
   Alias /perlrun/  @ServerRoot@/cgi-bin/
   
  +ScriptAlias /cgi-bin/ @ServerRoot@/cgi-bin/
  +
   PerlModule ModPerl::RegistryBB
   Location /registry_bb
   PerlOptions +GlobalRequest
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry Makefile.PL

2003-02-06 Thread stas
stas2003/02/06 16:08:34

  Modified:ModPerl-Registry Makefile.PL
  Log:
  enable SMOKE script creation for ModPerl-Registry
  
  Revision  ChangesPath
  1.7   +4 -0  modperl-2.0/ModPerl-Registry/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/Makefile.PL,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Makefile.PL   14 May 2002 15:57:14 -  1.6
  +++ Makefile.PL   7 Feb 2003 00:08:34 -   1.7
  @@ -5,6 +5,7 @@
   use lib map {($_, ../$_) } qw(lib Apache-Test/lib);
   
   use ModPerl::MM ();
  +use Apache::TestSmokePerl ();
   
   # enable 'make test|clean'
   use Apache::TestMM qw(test clean);
  @@ -19,6 +20,9 @@
   # accept the configs from comman line
   Apache::TestMM::filter_args();
   Apache::TestMM::generate_script('t/TEST');
  +
  +# t/SMOKE
  +Apache::TestSmokePerl-generate_script;
   
   ModPerl::MM::WriteMakefile(
   NAME = 'ModPerl::Registry',
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm

2003-02-06 Thread stas
stas2003/02/06 16:12:25

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  always return the run's return status if it's not Apache::OK
  
  Revision  ChangesPath
  1.31  +5 -7  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- RegistryCooker.pm 5 Feb 2003 04:06:27 -   1.30
  +++ RegistryCooker.pm 7 Feb 2003 00:12:25 -   1.31
  @@ -159,15 +159,13 @@
   return $rc unless $rc == Apache::OK;
   }
   
  -# handlers shouldn't set $r-status but return it
  +# handlers shouldn't set $r-status but return it, so we reset the
  +# status after running it
   my $old_status = $self-[REQ]-status;
   my $rc = $self-run;
  -my $new_status = $self-[REQ]-status;
  -
  -# only if the script has changed the status, reset to the old
  -# status and return the new status
  -return $old_status != $new_status 
  -? $self-[REQ]-status($old_status)
  +my $new_status = $self-[REQ]-status($old_status);
  +return ($rc == Apache::OK  $old_status != $new_status)
  +? $new_status
   : $rc;
   }
   
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin runtime_error_n_status_change.pl runtime_error_plus_body.pl runtime_error.pl

2003-02-06 Thread stas
stas2003/02/06 16:15:39

  Modified:ModPerl-Registry/t .cvsignore 500.t
   ModPerl-Registry/t/cgi-bin runtime_error.pl
  Added:   ModPerl-Registry/t/cgi-bin runtime_error_n_status_change.pl
runtime_error_plus_body.pl
  Log:
  add several more tests which explore various situations when runtime
  errors happen
  
  Revision  ChangesPath
  1.3   +1 -0  modperl-2.0/ModPerl-Registry/t/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/.cvsignore,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .cvsignore18 Oct 2001 04:25:12 -  1.2
  +++ .cvsignore7 Feb 2003 00:15:39 -   1.3
  @@ -1,3 +1,4 @@
   logs
   htdocs
   TEST
  +SMOKE
  
  
  
  1.3   +44 -4 modperl-2.0/ModPerl-Registry/t/500.t
  
  Index: 500.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/500.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- 500.t 23 Jan 2003 01:12:01 -  1.2
  +++ 500.t 7 Feb 2003 00:15:39 -   1.3
  @@ -5,7 +5,21 @@
   use Apache::TestUtil;
   use Apache::TestRequest qw(GET);
   
  -plan tests = 3;
  +plan tests = 6;
  +
  +{
  +# the script changes the status before the run-time error happens,
  +# this status change should be ignored
  +my $url = /registry/runtime_error_n_status_change.pl;
  +my $res = GET($url);
  +#t_debug($res-content);
  +ok t_cmp(
  +500,
  +$res-code,
  +500 error on runtime error (when the script changes the status),
  +   );
  +}
  +
   
   
   {
  @@ -20,6 +34,21 @@
   }
   
   {
  +my $url = /registry/missing_headers.pl;
  +my $res = GET($url);
  +#t_debug($res-content);
  +ok t_cmp(
  +500,
  +$res-code,
  +500 error on missing HTTP headers,
  +   );
  +}
  +
  +{
  +# since we have a runtime error before any body is sent, mod_perl
  +# has a chance to communicate the return status of the script to
  +# Apache before headers are sent, so we get the code 500 in the
  +# HTTP headers
   my $url = /registry/runtime_error.pl;
   my $res = GET($url);
   #t_debug($res-content);
  @@ -31,12 +60,23 @@
   }
   
   {
  -my $url = /registry/missing_headers.pl;
  +# even though we have a runtime error here, the scripts succeeds
  +# to send some body before the error happens and since by that
  +# time Apache has already sent the headers, they will include 
  +# 200 OK
  +my $url = /registry/runtime_error_plus_body.pl;
   my $res = GET($url);
   #t_debug($res-content);
   ok t_cmp(
  -500,
  +200,
   $res-code,
  -500 error on missing HTTP headers,
  +200, followed by a runtime error,
  +   );
  +
  +# the error message is attached after the body
  +ok t_cmp(
  +qr/some body.*The server encountered an internal error/ms,
  +$res-content,
  +200, followed by a runtime error,
  );
   }
  
  
  
  1.2   +3 -0  modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error.pl
  
  Index: runtime_error.pl
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- runtime_error.pl  23 Jan 2003 01:12:01 -  1.1
  +++ runtime_error.pl  7 Feb 2003 00:15:39 -   1.2
  @@ -1,2 +1,5 @@
  +# this script sends no body at all, and since the error happens
  +# the script will return 500
  +
   print Content-type: text/plain\n\n;
   print no_such_func();
  
  
  
  1.1  
modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl
  
  Index: runtime_error_n_status_change.pl
  ===
  my $r = shift;
  $r-status(404);
  $r-send_http_header('text/plain');
  $r-print(no_such_func());
  
  
  
  1.1  
modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_plus_body.pl
  
  Index: runtime_error_plus_body.pl
  ===
  # this script sends some body before the error happens,
  # so 200 OK is expected, followed by an error
  print Content-type: text/plain\n\n;
  print some body;
  print no_such_func();
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin runtime_error_n_status_change.pl status_change.pl

2003-02-06 Thread stas
stas2003/02/06 16:23:31

  Modified:ModPerl-Registry/t/cgi-bin runtime_error_n_status_change.pl
status_change.pl
  Log:
  don't use the 1.x compat api
  
  Revision  ChangesPath
  1.2   +1 -1  
modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl
  
  Index: runtime_error_n_status_change.pl
  ===
  RCS file: 
/home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/runtime_error_n_status_change.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- runtime_error_n_status_change.pl  7 Feb 2003 00:15:39 -   1.1
  +++ runtime_error_n_status_change.pl  7 Feb 2003 00:23:31 -   1.2
  @@ -1,4 +1,4 @@
   my $r = shift;
   $r-status(404);
  -$r-send_http_header('text/plain');
  +$r-print(Content-type: text/plain\n\n);
   $r-print(no_such_func());
  
  
  
  1.2   +1 -1  modperl-2.0/ModPerl-Registry/t/cgi-bin/status_change.pl
  
  Index: status_change.pl
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/cgi-bin/status_change.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- status_change.pl  7 Feb 2003 00:13:40 -   1.1
  +++ status_change.pl  7 Feb 2003 00:23:31 -   1.2
  @@ -1,3 +1,3 @@
   my $r = shift;
   $r-status(404);
  -$r-send_http_header('text/plain');
  +$r-print(Content-type: text/plain\n\n);
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t closure.t

2003-02-06 Thread stas
stas2003/02/06 16:40:32

  Modified:ModPerl-Registry/t closure.t
  Log:
  correct the explanation
  
  Revision  ChangesPath
  1.6   +3 -2  modperl-2.0/ModPerl-Registry/t/closure.t
  
  Index: closure.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/closure.t,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- closure.t 22 May 2002 05:40:48 -  1.5
  +++ closure.t 7 Feb 2003 00:40:32 -   1.6
  @@ -118,9 +118,10 @@
   
   sub sleep_and_touch_file {
   my $file = shift;
  -# need to wait at least 1 whole sec, so -M will notice the
  +# need to wait at least 1 whole sec, so utime() will notice the
   # difference. select() has better resolution than 1 sec as in
  -# sleep()
  +# sleep() so we are more likely to have the minimal waiting time,
  +# while fullfilling the purpose
   select undef, undef, undef, 1.00; # sure 1 sec
   my $now = time;
   utime $now, $now, $file;
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t closure.t

2003-02-06 Thread stas
stas2003/02/06 16:51:08

  Modified:ModPerl-Registry/t closure.t
  Log:
  spel
  
  Revision  ChangesPath
  1.7   +1 -1  modperl-2.0/ModPerl-Registry/t/closure.t
  
  Index: closure.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/closure.t,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- closure.t 7 Feb 2003 00:40:32 -   1.6
  +++ closure.t 7 Feb 2003 00:51:08 -   1.7
  @@ -121,7 +121,7 @@
   # need to wait at least 1 whole sec, so utime() will notice the
   # difference. select() has better resolution than 1 sec as in
   # sleep() so we are more likely to have the minimal waiting time,
  -# while fullfilling the purpose
  +# while fulfilling the purpose
   select undef, undef, undef, 1.00; # sure 1 sec
   my $now = time;
   utime $now, $now, $file;
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_filter.c

2003-02-06 Thread stas
stas2003/02/06 18:30:53

  Modified:src/modules/perl modperl_filter.c
  Log:
  we have no choice but to truncate wb-outbuf to the size of 'len'. All
  kind of weird problems pop-up when the previous request was proper and the
  current request has messed up with headers, because
  modperl_cgi_header_parse (actually the ap_scan_script_header_err_strs)
  will get things messed up because it expects a buffer with real data only.
  
  Revision  ChangesPath
  1.50  +24 -23modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.49
  retrieving revision 1.50
  diff -u -r1.49 -r1.50
  --- modperl_filter.c  7 Feb 2003 00:07:42 -   1.49
  +++ modperl_filter.c  7 Feb 2003 02:30:52 -   1.50
  @@ -8,11 +8,28 @@
   apr_bucket_alloc_t *ba = (*wb-filters)-c-bucket_alloc;
   apr_bucket_brigade *bb;
   apr_bucket *bucket;
  -
  +const char *work_buf = buf;
  +
   if (wb-header_parse) {
   request_rec *r = wb-r;
   const char *bodytext = NULL;
  -int status = modperl_cgi_header_parse(r, (char *)buf, bodytext);
  +int status;
  +/*
  + * since wb-outcnt is persistent between requests, if the
  + * current response is shorter than the size of wb-outcnt
  + * it may include data from the previous request at the
  + * end. When this function receives a pointer to
  + * wb-outbuf as 'buf', modperl_cgi_header_parse may
  + * return that irrelevant data as part of 'bodytext'. So
  + * to avoid this risk, we create a new buffer of size 'len'
  + * XXX: if buf wasn't 'const char *buf' we could simply do
  + * buf[len] = '\0'
  + */
  +if (len  strlen(buf)) {
  +work_buf = (char *)apr_pcalloc(wb-pool, sizeof(char*)*len);
  +memcpy((void*)work_buf, buf, len);
  +}
  +status = modperl_cgi_header_parse(r, (char *)work_buf, bodytext);
   
   wb-header_parse = 0; /* only once per-request */
   
  @@ -26,32 +43,16 @@
   /* XXX: bodytext == NULL here */
   return status;
   }
  -
  -if (!bodytext) {
  +else if (!bodytext) {
   return APR_SUCCESS;
   }
  -else {
  -len -= (bodytext - buf);
  -buf = bodytext;
  -/*
  - * since wb-outbuf is persistent between requests, if the
  - * current response is shorter than the size of wb-outbuf
  - * it may include data from the previous request at the
  - * end. When this function receives a pointer to
  - * wb-outbuf as 'buf', modperl_cgi_header_parse may
  - * return that irrelevant data as part of 'bodytext'. So
  - * to avoid this risk, we check whether there is any real
  - * data to send and if not return.
  - */
  -if (!len) {
  -return APR_SUCCESS;
  -}
  -}
  -
  +
  +len -= (bodytext - work_buf);
  +work_buf = bodytext;
   }
   
   bb = apr_brigade_create(wb-pool, ba);
  -bucket = apr_bucket_transient_create(buf, len, ba);
  +bucket = apr_bucket_transient_create(work_buf, len, ba);
   APR_BRIGADE_INSERT_TAIL(bb, bucket);
   
   MP_TRACE_f(MP_FUNC, buffer length=%d\n, len);
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/cgi-bin content_type.pl

2003-02-06 Thread stas
stas2003/02/06 18:49:01

  Modified:src/modules/perl modperl_filter.c
   ModPerl-Registry/t basic.t
  Added:   ModPerl-Registry/t/cgi-bin content_type.pl
  Log:
  if the handler sets the content-type, don't parse the headers because
  there most likely there will be none
  
  Revision  ChangesPath
  1.51  +3 -3  modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.50
  retrieving revision 1.51
  diff -u -r1.50 -r1.51
  --- modperl_filter.c  7 Feb 2003 02:30:52 -   1.50
  +++ modperl_filter.c  7 Feb 2003 02:49:01 -   1.51
  @@ -10,13 +10,13 @@
   apr_bucket *bucket;
   const char *work_buf = buf;
   
  -if (wb-header_parse) {
  +if (wb-header_parse  !wb-r-content_type) {
   request_rec *r = wb-r;
   const char *bodytext = NULL;
   int status;
   /*
  - * since wb-outcnt is persistent between requests, if the
  - * current response is shorter than the size of wb-outcnt
  + * since wb-outbuf is persistent between requests, if the
  + * current response is shorter than the size of wb-outbuf
* it may include data from the previous request at the
* end. When this function receives a pointer to
* wb-outbuf as 'buf', modperl_cgi_header_parse may
  
  
  
  1.9   +53 -42modperl-2.0/ModPerl-Registry/t/basic.t
  
  Index: basic.t
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/basic.t,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- basic.t   6 Jan 2003 10:39:43 -   1.8
  +++ basic.t   7 Feb 2003 02:49:01 -   1.9
  @@ -13,58 +13,69 @@
   
   my @aliases = sort keys %modules;
   
  -plan tests = @aliases * 4 + 1;
  +plan tests = 2;
  +#plan tests = @aliases * 4 + 2;
   
  -# very basic compilation/response test
  -for my $alias (@aliases) {
  -my $url = /$alias/basic.pl;
  -
  -ok t_cmp(
  -ok,
  -GET_BODY($url),
  -$modules{$alias} basic cgi test,
  -);
  -}
  -
  -# test non-executable bit
  -for my $alias (@aliases) {
  -my $url = /$alias/not_executable.pl;
  -
  -ok t_cmp(
  -403 Forbidden,
  -HEAD($url)-status_line(),
  -$modules{$alias} non-executable file,
  -);
  -}
  -
  -# test environment pre-set
  -for my $alias (@aliases) {
  -my $url = /$alias/env.pl?foo=bar;
  +## very basic compilation/response test
  +#for my $alias (@aliases) {
  +#my $url = /$alias/basic.pl;
  +
  +#ok t_cmp(
  +#ok,
  +#GET_BODY($url),
  +#$modules{$alias} basic cgi test,
  +#);
  +#}
  +
  +## test non-executable bit
  +#for my $alias (@aliases) {
  +#my $url = /$alias/not_executable.pl;
  +
  +#ok t_cmp(
  +#403 Forbidden,
  +#HEAD($url)-status_line(),
  +#$modules{$alias} non-executable file,
  +#);
  +#}
  +
  +## test environment pre-set
  +#for my $alias (@aliases) {
  +#my $url = /$alias/env.pl?foo=bar;
  +
  +#ok t_cmp(
  +#foo=bar,
  +#GET_BODY($url),
  +#$modules{$alias} mod_cgi-like environment pre-set,
  +#);
  +#}
  +
  +## require (actually chdir test)
  +#for my $alias (@aliases) {
  +#my $url = /$alias/require.pl;
  +
  +#ok t_cmp(
  +#it works,
  +#GET_BODY($url),
  +#$modules{$alias} mod_cgi-like environment pre-set,
  +#);
  +#}
   
  +# test method handlers
  +{
  +my $url = /registry_oo_conf/env.pl?foo=bar;
   ok t_cmp(
   foo=bar,
   GET_BODY($url),
  -$modules{$alias} mod_cgi-like environment pre-set,
  -);
  -}
  -
  -# require (actually chdir test)
  -for my $alias (@aliases) {
  -my $url = /$alias/require.pl;
  -
  -ok t_cmp(
  -it works,
  -GET_BODY($url),
  -$modules{$alias} mod_cgi-like environment pre-set,
  +ModPerl::Registry-handler mod_cgi-like environment pre-set,
   );
   }
   
  -# test method handlers
  +# test mod_perl api usage
   {
  -my $url = /registry_oo_conf/env.pl?foo=bar;
  +my $url = /registry/content_type.pl;
   ok t_cmp(
  -foo=bar,
  +ok,
   GET_BODY($url),
  -ModPerl::Registry-handler mod_cgi-like environment pre-set,
  +\$r-content_type('text/plain'),
   );
   }
  
  
  
  1.1  modperl-2.0/ModPerl-Registry/t/cgi-bin/content_type.pl
  
  Index: content_type.pl
  ===
  my $r = shift;
  $r-content_type('text/plain');
  $r-print('ok');
  
  
  



cvs commit: modperl-2.0 Changes

2003-02-06 Thread stas
stas2003/02/06 18:58:30

  Modified:.Changes
  Log:
  log the recent changes
  
  Revision  ChangesPath
  1.123 +5 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.122
  retrieving revision 1.123
  diff -u -r1.122 -r1.123
  --- Changes   5 Feb 2003 04:06:27 -   1.122
  +++ Changes   7 Feb 2003 02:58:30 -   1.123
  @@ -10,6 +10,11 @@
   
   =item 1.99_09-dev
   
  +Several issues resolved with parsing headers, including making work
  +the handlers calling $r-content_type() and not sending raw headers,
  +when the headers scanning is turned on. Lots of tests added to
  +exercise different situations. [Stas]
  +
   warn on using -T in ModPerl::Registry scripts when mod_perl is not
   running with -T [Stas]
   
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry TODO

2003-02-04 Thread stas
stas2003/02/04 20:06:28

  Modified:.Changes
   ModPerl-Registry/lib/ModPerl RegistryCooker.pm
   ModPerl-Registry TODO
  Log:
  warn on using -T in ModPerl::Registry scripts when mod_perl is not
  running with -T
  
  Revision  ChangesPath
  1.122 +7 -4  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.121
  retrieving revision 1.122
  diff -u -r1.121 -r1.122
  --- Changes   4 Feb 2003 06:52:15 -   1.121
  +++ Changes   5 Feb 2003 04:06:27 -   1.122
  @@ -10,10 +10,13 @@
   
   =item 1.99_09-dev
   
  -perl 5.7.3+ has a built-in ${^TAINT} to test whether running under
  --(T|t). Backport ${^TAINT} for mod_perl running under 5.6.0-5.7.3,
  -(what used to be $Apache::__T.  $Apache::__T is available too, but
  -deprecated. [Stas]
  +warn on using -T in ModPerl::Registry scripts when mod_perl is not
  +running with -T [Stas]
  +
  +perl 5.7.3+ has a built-in ${^TAINT} to test whether it's running
  +under -(T|t). Backport ${^TAINT} for mod_perl running under
  +5.6.0-5.7.3, (what used to be $Apache::__T.  $Apache::__T is available
  +too, but deprecated. [Stas]
   
   add PerlChildExitHandler implementation [Stas]
   
  
  
  
  1.30  +4 -5  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- RegistryCooker.pm 18 Jan 2003 02:04:32 -  1.29
  +++ RegistryCooker.pm 5 Feb 2003 04:06:27 -   1.30
  @@ -552,10 +552,9 @@
   
   my %switches = (
  'T' = sub {
  -# XXX: need to have $Apache::__T set by the core on PerlSwitches -T
  -#   Apache::warn(T switch is ignored, ,
  -#enable with 'PerlSwitches -T' in httpd.conf\n)
  -# unless $Apache::__T; 
  +   Apache::warn(-T switch is ignored,  .
  +enable with 'PerlSwitches -T' in httpd.conf\n)
  + unless ${^TAINT};
  ;
  },
  'w' = sub { use warnings;\n },
  @@ -574,7 +573,7 @@
last if substr($s,0,1) eq -;
for (split //, $s) {
next unless exists $switches{$_};
  - $prepend .= {$switches{$_}};
  + $prepend .= $switches{$_}-();
}
   }
   ${ $self-[CODE] } =~ s/^/$prepend/ if $prepend;
  
  
  
  1.12  +0 -2  modperl-2.0/ModPerl-Registry/TODO
  
  Index: TODO
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- TODO  29 Dec 2002 10:11:49 -  1.11
  +++ TODO  5 Feb 2003 04:06:27 -   1.12
  @@ -14,8 +14,6 @@
   
   ### missing features ###
   
  -- need to port $Apache::__T, to test against when user supplies -T flag.
  -
   - port Apache::PerlRunXS
   
   - replace the local implementation of slurp_filename() and finfo(),
  
  
  



cvs commit: modperl-2.0/lib/Apache Status.pm

2003-02-03 Thread stas
stas2003/02/03 23:00:52

  Modified:lib/Apache Status.pm
  Log:
  of course we don't have 2.00 yet, use 1.99
  
  Revision  ChangesPath
  1.6   +1 -4  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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Status.pm 28 Jan 2003 07:27:48 -  1.5
  +++ Status.pm 4 Feb 2003 07:00:52 -   1.6
  @@ -9,10 +9,7 @@
   # when used with 'no warnings' it still barks on redefinining the
   # constants
   
  -
  -
  -# XXX
  -# use mod_perl 2.0;
  +use mod_perl 1.99;
   
   use Apache::RequestRec ();
   use Apache::RequestUtil ();
  
  
  



cvs commit: modperl-2.0/lib/ModPerl Code.pm

2003-02-02 Thread stas
stas2003/02/02 17:18:15

  Modified:lib/ModPerl Code.pm
  Log:
  fix the indentation for the autogenerated files
  
  Revision  ChangesPath
  1.90  +1 -1  modperl-2.0/lib/ModPerl/Code.pm
  
  Index: Code.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/Code.pm,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- Code.pm   11 Jan 2003 03:20:54 -  1.89
  +++ Code.pm   3 Feb 2003 01:18:15 -   1.90
  @@ -62,7 +62,7 @@
   my $scfg_get = 'MP_dSCFG(parms-server)';
   
   my $dcfg_get = $scfg_get;\n .
  -  'modperl_config_dir_t *dcfg = (modperl_config_dir_t *)dummy';
  +  'modperl_config_dir_t *dcfg = (modperl_config_dir_t *)dummy';
   
   my %directive_proto = (
   PerSrv = {
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_config.c

2003-02-02 Thread stas
stas2003/02/02 22:40:33

  Modified:.Changes
   src/modules/perl modperl_config.c
  Added:   t/hooks  cleanup.t
   t/hooks/TestHooks cleanup.pm
  Log:
  PerlCleanupHandler implementation + tests
  
  Revision  ChangesPath
  1.119 +8 -1  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- Changes   31 Jan 2003 03:15:24 -  1.118
  +++ Changes   3 Feb 2003 06:40:33 -   1.119
  @@ -10,8 +10,15 @@
   
   =item 1.99_09-dev
   
  +add PerlCleanupHandler implementation + test [Stas]
  +
  +Apache::Test now can run 'make test' under 'root', without permission
  +problems (e.g. when files need to be written), it'll chown all the
  +files under t/ to the user chosen to run the server with, before
  +running the tests and will restore the permissions at the end. [Stas]
  +
   die when Apache-request returns nothing ('PerlOptions -GlobalRequest'
  -or 'SetHandler modperl' [Stas]
  +or 'SetHandler modperl') [Stas]
   
   New Apache::Directive methods: as_hash(), lookup() + tests + docs
   [Philippe M. Chiasson [EMAIL PROTECTED]]
  
  
  
  1.1  modperl-2.0/t/hooks/cleanup.t
  
  Index: cleanup.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  use File::Spec::Functions qw(catfile catdir);
  
  my $vars = Apache::Test::config-{vars};
  my $dir  = catdir $vars-{documentroot}, hooks;
  my $file = catfile $dir, cleanup;
  
  plan tests = 2;
  
  {
  # this registers and performs cleanups, but we test whether the
  # cleanup was run only in the next sub-test
  my $location = /TestHooks::cleanup;
  my $expected = 'ok';
  my $received = GET_BODY $location;
  ok t_cmp($expected, $received, register req cleanup);
  }
  
  {
  # this sub-tests checks that the cleanup stage was run successfully
  
  # since Apache destroys the request rec after the logging has been
  # finished, we have to give it some time  to get there
  # and fill in the file. (wait 0.25 .. 5 sec)
  my $t = 0;
  select undef, undef, undef, 0.25
  until -e $file  -s _ == 10 || $t++ == 20;
  
  unless (-e $file) {
  t_debug(can't find $file);
  ok 0;
  }
  else {
  open my $fh, $file or die Can't open $file: $!;
  my $received = $fh || '';
  close $fh;
  my $expected = cleanup ok;
  ok t_cmp($expected, $received, verify req cleanup execution);
  
  # XXX: while Apache::TestUtil fails to cleanup by itself
  unlink $file;
  }
  
  }
  
  
  
  
  
  
  1.1  modperl-2.0/t/hooks/TestHooks/cleanup.pm
  
  Index: cleanup.pm
  ===
  package TestHooks::cleanup;
  
  # test various ways to push handlers
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use File::Spec::Functions qw(catfile catdir);
  
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  use Apache::RequestUtil ();
  
  use Apache::Const -compile = qw(OK DECLINED);
  
  sub get_file {
  catdir Apache::Test::config-{vars}-{documentroot}, hooks, cleanup;
  }
  
  sub handler {
  my $r = shift;
  
  $r-content_type('text/plain');
  $r-print('ok');
  
  $r-push_handlers(PerlCleanupHandler = \cleanup2);
  
  return Apache::OK;
  }
  
  sub cleanup1 {
  my $r = shift;
  
  #warn cleanup CALLED\n;
  t_write_file(get_file(), cleanup);
  
  return Apache::OK;
  }
  
  sub cleanup2 {
  my $r = shift;
  
  #warn cleanup2 CALLED\n;
  t_append_file(get_file(),  ok);
  
  return Apache::OK;
  }
  
  1;
  __DATA__
  NoAutoConfig
Location /TestHooks::cleanup
SetHandler modperl
PerlCleanupHandler  TestHooks::cleanup::cleanup1
PerlResponseHandler TestHooks::cleanup
/Location
  /NoAutoConfig
  
  
  
  
  1.62  +4 -1  modperl-2.0/src/modules/perl/modperl_config.c
  
  Index: modperl_config.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_config.c,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- modperl_config.c  1 Jan 2003 03:45:54 -   1.61
  +++ modperl_config.c  3 Feb 2003 06:40:33 -   1.62
  @@ -278,6 +278,7 @@
   
   apr_status_t modperl_config_request_cleanup(pTHX_ request_rec *r)
   {
  +apr_status_t retval;
   MP_dRCFG;
   
   if (rcfg-pnotes) {
  @@ -285,7 +286,9 @@
   rcfg-pnotes = Nullhv;
   }
   
  -return APR_SUCCESS;
  +retval = modperl_callback_per_dir

cvs commit: modperl-2.0/lib/Apache Build.pm

2003-01-31 Thread stas
stas2003/01/31 23:39:43

  Modified:lib/Apache Build.pm
  Log:
  - create MKPATH make variable as we are going to use it more than once
there is no need to test for the existance of the path, before calling
mkpath(), it does no harm if the dir already exists
  - use the MKPATH variable
  
  Revision  ChangesPath
  1.110 +3 -3  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.109
  retrieving revision 1.110
  diff -u -r1.109 -r1.110
  --- Build.pm  14 Dec 2002 17:29:34 -  1.109
  +++ Build.pm  1 Feb 2003 07:39:43 -   1.110
  @@ -1052,14 +1052,14 @@
   
   MODPERL_PIC_OBJS = $(MODPERL_O_PIC_FILES) $(MODPERL_XS_O_PIC_FILES)
   
  +MKPATH = $(MODPERL_PERLPATH) -MExtUtils::Command -e mkpath
  +
   all: lib
   
   lib: $(MODPERL_LIB)
   
   install:
  - $(MODPERL_PERLPATH) -e exit ! -d qq{$(MODPERL_AP_LIBEXECDIR)} || \
  - $(MODPERL_PERLPATH) -MExtUtils::Command  \
  - -e mkpath $(MODPERL_AP_LIBEXECDIR)
  + @$(MKPATH) $(MODPERL_AP_LIBEXECDIR)
$(MODPERL_TEST_F) $(MODPERL_LIB_DSO)  \
$(MODPERL_CP) $(MODPERL_LIB_DSO) $(MODPERL_AP_LIBEXECDIR)
   
  
  
  



cvs commit: modperl-2.0 Makefile.PL

2003-01-30 Thread stas
stas2003/01/30 16:52:22

  Modified:.Makefile.PL
  Log:
  use a portable $(MAKE) instead of just 'make'
  
  Revision  ChangesPath
  1.91  +1 -1  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- Makefile.PL   23 Jan 2003 05:16:30 -  1.90
  +++ Makefile.PL   31 Jan 2003 00:52:21 -  1.91
  @@ -460,7 +460,7 @@
$(PASSENV) \
$(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
t/TEST
  - cd ModPerl-Registry  make test
  + cd ModPerl-Registry  $(MAKE) test
   
   test :: pure_all run_tests test_clean
   EOF
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-30 Thread stas
stas2003/01/30 20:20:20

  Modified:src/modules/perl modperl_global.c modperl_global.h
   xs/Apache/RequestUtil Apache__RequestUtil.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  expose modperl_global_request (needed in external apps written in XS )
  
  Revision  ChangesPath
  1.7   +24 -0 modperl-2.0/src/modules/perl/modperl_global.c
  
  Index: modperl_global.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_global.c,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- modperl_global.c  22 May 2002 18:53:33 -  1.6
  +++ modperl_global.c  31 Jan 2003 04:20:20 -  1.7
  @@ -26,6 +26,30 @@
   MpReqSET_GLOBAL_REQUEST_On(rcfg);
   }
   
  +/* get/set */
  +request_rec *modperl_global_request(pTHX_ SV *svr)
  +{
  +request_rec *cur = NULL;
  +apr_status_t status = modperl_tls_get_request_rec(cur);
  +
  +if (status != APR_SUCCESS) {
  +/* an internal problem */
  +Perl_croak(aTHX_ failed to retrieve the request object);
  +}
  +
  +if (!cur) {
  +/* wrong configuration */
  +Perl_croak(aTHX_ Global $r object is not available. Set:\n
  +   \tPerlOptions +GlobalRequest\nin httpd.conf);
  +}
  +
  +if (svr) {
  +modperl_global_request_obj_set(aTHX_ svr);
  +}
  +
  +return cur;
  +}
  +
   void modperl_global_request_obj_set(pTHX_ SV *svr)
   {
   /* XXX: support sublassing */
  
  
  
  1.4   +2 -0  modperl-2.0/src/modules/perl/modperl_global.h
  
  Index: modperl_global.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_global.h,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- modperl_global.h  4 May 2001 05:49:19 -   1.3
  +++ modperl_global.h  31 Jan 2003 04:20:20 -  1.4
  @@ -18,6 +18,8 @@
   
   void modperl_global_request_cfg_set(request_rec *r);
   
  +request_rec *modperl_global_request(pTHX_ SV *svr);
  +
   void modperl_global_request_set(request_rec *r);
   
   void modperl_global_request_obj_set(pTHX_ SV *svr);
  
  
  
  1.17  +2 -19 modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h
  
  Index: Apache__RequestUtil.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/RequestUtil/Apache__RequestUtil.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- Apache__RequestUtil.h 31 Jan 2003 03:15:23 -  1.16
  +++ Apache__RequestUtil.h 31 Jan 2003 04:20:20 -  1.17
  @@ -85,25 +85,8 @@
   static MP_INLINE
   request_rec *mpxs_Apache_request(pTHX_ SV *classname, SV *svr)
   {
  -request_rec *cur = NULL;
  -apr_status_t status = modperl_tls_get_request_rec(cur);
  -
  -if (status != APR_SUCCESS) {
  -/* an internal problem */
  -Perl_croak(aTHX_ failed to retrieve the request object);
  -}
  -
  -if (!cur) {
  -/* wrong configuration */
  -Perl_croak(aTHX_ Global $r object is not available. Set:\n
  -   \tPerlOptions +GlobalRequest\nin httpd.conf);
  -}
  -
  -if (svr) {
  -modperl_global_request_obj_set(aTHX_ svr);
  -}
  -
  -return cur;
  +/* ignore classname */
  +return modperl_global_request(aTHX_ svr);
   }
   
   static MP_INLINE
  
  
  
  1.104 +14 -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.103
  retrieving revision 1.104
  diff -u -r1.103 -r1.104
  --- FunctionTable.pm  29 Jan 2003 03:56:00 -  1.103
  +++ FunctionTable.pm  31 Jan 2003 04:20:20 -  1.104
  @@ -1494,6 +1494,20 @@
   'args' = []
 },
 {
  +'return_type' = 'request_rec *',
  +'name' = 'modperl_global_request',
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'SV *',
  +'name' = 'svr'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'SV *',
   'name' = 'modperl_dir_config',
   'attr' = [
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_callback.c

2003-01-28 Thread stas
stas2003/01/28 17:04:34

  Modified:.Changes
   src/modules/perl modperl_callback.c
  Added:   t/hooks  stacked_handlers.t
   t/hooks/TestHooks stacked_handlers.pm
  Log:
  Stacked handlers chain execution is now aborted when a handler returns
  something other than OK or DECLINED
  
  Revision  ChangesPath
  1.116 +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.115
  retrieving revision 1.116
  diff -u -r1.115 -r1.116
  --- Changes   25 Jan 2003 03:08:04 -  1.115
  +++ Changes   29 Jan 2003 01:04:33 -  1.116
  @@ -10,6 +10,9 @@
   
   =item 1.99_09-dev
   
  +Stacked handlers chain execution is now aborted when a handler returns
  +something other than OK or DECLINED [Stas]
  +
   make $filter-read() in input streaming filters, use the same number
   of arguments as read() in the output filters. [Stas]
   
  
  
  
  1.1  modperl-2.0/t/hooks/stacked_handlers.t
  
  Index: stacked_handlers.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  plan tests = 1;
  
  my $location = /TestHooks::stacked_handlers;
  my $expected = join \n, qw(one two three), '';
  my $received = GET_BODY $location;
  
  ok t_cmp($expected, $received, stacked_handlers);
  
  
  
  1.1  modperl-2.0/t/hooks/TestHooks/stacked_handlers.pm
  
  Index: stacked_handlers.pm
  ===
  package TestHooks::stacked_handlers;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  
  use Apache::Const -compile = qw(OK DECLINED);
  
  sub handler {
  my $r = shift;
  
  $r-handler(modperl);
  $r-push_handlers(PerlResponseHandler = [\one, \two, \three, \four]);
  
  return Apache::OK;
  }
  
  sub one {
  my $r = shift;
  
  $r-content_type('text/plain');
  $r-print(one\n);
  
  return Apache::OK;
  }
  
  sub two {
  my $r = shift;
  
  $r-print(two\n);
  
  return Apache::OK;
  }
  
  sub three {
  my $r = shift;
  
  $r-print(three\n);
  
  return Apache::DONE;
  }
  
  # this one shouldn't get called, because the three has returned DONE
  sub four {
  my $r = shift;
  
  $r-print(four\n);
  
  return Apache::OK;
  }
  
  
  1;
  __DATA__
  NoAutoConfig
Location /TestHooks::stacked_handlers
SetHandler modperl
PerlHeaderParserHandler TestHooks::stacked_handlers
/Location
  /NoAutoConfig
  
  
  
  
  1.53  +12 -3 modperl-2.0/src/modules/perl/modperl_callback.c
  
  Index: modperl_callback.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- modperl_callback.c14 Jan 2003 06:42:43 -  1.52
  +++ modperl_callback.c29 Jan 2003 01:04:33 -  1.53
  @@ -182,12 +182,21 @@
   handlers = (modperl_handler_t **)av-elts;
   
   for (i=0; inelts; i++) {
  -if ((status = modperl_callback(aTHX_ handlers[i], p, r, s, av_args)) != OK) 
{
  +status = modperl_callback(aTHX_ handlers[i], p, r, s, av_args);
  +
  +MP_TRACE_h(MP_FUNC, %s returned %d\n, handlers[i]-name, status);
  +
  +if ((status != OK)  (status != DECLINED)) {
   status = modperl_errsv(aTHX_ status, r, s);
  +#ifdef MP_TRACE
  +if (i+1 != nelts) {
  +MP_TRACE_h(MP_FUNC, there were %d uncalled handlers\n,
  +   nelts-i-1);
  +}
  +#endif
  +break;
   }
   
  -MP_TRACE_h(MP_FUNC, %s returned %d\n,
  -   handlers[i]-name, status);
   }
   
   SvREFCNT_dec((SV*)av_args);
  
  
  



cvs commit: modperl-2.0/t/hooks/TestHooks push_handlers.pm

2003-01-28 Thread stas
stas2003/01/28 17:25:46

  Added:   t/hooks  push_handlers.t
   t/hooks/TestHooks push_handlers.pm
  Log:
  - add a test to exercise push_handlers in different ways
  - prepare for supporting anon handlers
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/hooks/push_handlers.t
  
  Index: push_handlers.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  plan tests = 1;
  
  my @refs = qw(coderef full_coderef coderef1 coderef2 coderef3);
  my @anon = qw(anonymous anonymous1 coderef4 anonymous3);
  
  my @strings = @refs;
  
  # XXX: anon-handlers unsupported yet
  # push @strings, @anon
  
  my $location = /TestHooks::push_handlers;
  my $expected = join \n, @strings, '';
  my $received = GET_BODY $location;
  
  ok t_cmp($expected, $received, push_handlers ways);
  
  
  
  1.1  modperl-2.0/t/hooks/TestHooks/push_handlers.pm
  
  Index: push_handlers.pm
  ===
  package TestHooks::push_handlers;
  
  # test various ways to push handlers
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  
  use Apache::Const -compile = qw(OK DECLINED DONE);
  
  sub handler {
  my $r = shift;
  
  $r-handler(modperl);
  $r-push_handlers(PerlResponseHandler = \start);
  
  $r-push_handlers(PerlResponseHandler = \coderef);
  $r-push_handlers(PerlResponseHandler = 
  \TestHooks::push_handlers::full_coderef);
  
  $r-push_handlers(PerlResponseHandler =
  [\coderef1, \coderef2, \coderef3]);
  
  # XXX: anon-handlers unsupported yet
  #$r-push_handlers(PerlResponseHandler =
  #sub { return say(shift, anonymous) });
  
  #$r-push_handlers(PerlResponseHandler =
  #[sub { return say(shift, anonymous1) },
  # \coderef4,
  # sub { return say(shift, anonymous3) },
  #]);
  
  $r-push_handlers(PerlResponseHandler = \end);
  
  return Apache::DECLINED;
  }
  
  
  sub start { shift-content_type('text/plain'); return Apache::OK }
  sub end   { return Apache::DONE }
  sub say   { shift-print(shift,\n); return Apache::OK }
  
  sub coderef  { return say(shift, coderef)  }
  sub coderef1 { return say(shift, coderef1) }
  sub coderef2 { return say(shift, coderef2) }
  sub coderef3 { return say(shift, coderef3) }
  sub coderef4 { return say(shift, coderef4) }
  sub full_coderef { return say(shift, full_coderef) }
  
  1;
  __DATA__
  NoAutoConfig
Location /TestHooks::push_handlers
SetHandler modperl
PerlHeaderParserHandler TestHooks::push_handlers
/Location
  /NoAutoConfig
  
  
  
  



cvs commit: modperl-2.0/t/hooks/TestHooks push_handlers.pm

2003-01-28 Thread stas
stas2003/01/28 17:33:17

  Modified:t/hooks  push_handlers.t
   t/hooks/TestHooks push_handlers.pm
  Log:
  mix in the handlers configured from httpd.conf
  
  Revision  ChangesPath
  1.2   +2 -1  modperl-2.0/t/hooks/push_handlers.t
  
  Index: push_handlers.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/hooks/push_handlers.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- push_handlers.t   29 Jan 2003 01:25:45 -  1.1
  +++ push_handlers.t   29 Jan 2003 01:33:17 -  1.2
  @@ -7,7 +7,8 @@
   
   plan tests = 1;
   
  -my @refs = qw(coderef full_coderef coderef1 coderef2 coderef3);
  +my @refs = qw(conf conf1 conf2 coderef 
  + full_coderef coderef1 coderef2 coderef3);
   my @anon = qw(anonymous anonymous1 coderef4 anonymous3);
   
   my @strings = @refs;
  
  
  
  1.2   +12 -4 modperl-2.0/t/hooks/TestHooks/push_handlers.pm
  
  Index: push_handlers.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/push_handlers.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- push_handlers.pm  29 Jan 2003 01:25:45 -  1.1
  +++ push_handlers.pm  29 Jan 2003 01:33:17 -  1.2
  @@ -14,7 +14,6 @@
   my $r = shift;
   
   $r-handler(modperl);
  -$r-push_handlers(PerlResponseHandler = \start);
   
   $r-push_handlers(PerlResponseHandler = \coderef);
   $r-push_handlers(PerlResponseHandler = 
  @@ -38,11 +37,18 @@
   return Apache::DECLINED;
   }
   
  +sub end { return Apache::DONE }
  +sub say { shift-print(shift,\n); return Apache::OK }
   
  -sub start { shift-content_type('text/plain'); return Apache::OK }
  -sub end   { return Apache::DONE }
  -sub say   { shift-print(shift,\n); return Apache::OK }
  +sub conf {
  +# this one is configured from httpd.conf
  +my $r= shift;
  +$r-content_type('text/plain');
  +return say($r, conf);
  +}
   
  +sub conf1{ return say(shift, conf1)}
  +sub conf2{ return say(shift, conf2)}
   sub coderef  { return say(shift, coderef)  }
   sub coderef1 { return say(shift, coderef1) }
   sub coderef2 { return say(shift, coderef2) }
  @@ -56,6 +62,8 @@
 Location /TestHooks::push_handlers
 SetHandler modperl
 PerlHeaderParserHandler TestHooks::push_handlers
  +  PerlResponseHandler TestHooks::push_handlers::conf
  +  PerlResponseHandler TestHooks::push_handlers::conf1 
TestHooks::push_handlers::conf2
 /Location
   /NoAutoConfig
   
  
  
  



cvs commit: modperl-2.0/t/hooks/TestHooks push_handlers.pm stacked_handlers.pm

2003-01-28 Thread stas
stas2003/01/28 18:36:25

  Modified:t/hooks/TestHooks push_handlers.pm stacked_handlers.pm
  Log:
  add the missing Apache::ServerUtil
  
  Revision  ChangesPath
  1.3   +1 -0  modperl-2.0/t/hooks/TestHooks/push_handlers.pm
  
  Index: push_handlers.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/push_handlers.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- push_handlers.pm  29 Jan 2003 01:33:17 -  1.2
  +++ push_handlers.pm  29 Jan 2003 02:36:25 -  1.3
  @@ -7,6 +7,7 @@
   
   use Apache::RequestRec ();
   use Apache::RequestIO ();
  +use Apache::ServerUtil ();
   
   use Apache::Const -compile = qw(OK DECLINED DONE);
   
  
  
  
  1.3   +1 -0  modperl-2.0/t/hooks/TestHooks/stacked_handlers.pm
  
  Index: stacked_handlers.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/hooks/TestHooks/stacked_handlers.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- stacked_handlers.pm   29 Jan 2003 01:09:06 -  1.2
  +++ stacked_handlers.pm   29 Jan 2003 02:36:25 -  1.3
  @@ -9,6 +9,7 @@
   
   use Apache::RequestRec ();
   use Apache::RequestIO ();
  +use Apache::ServerUtil ();
   
   use Apache::Const -compile = qw(OK DECLINED DONE);
   
  
  
  



cvs commit: modperl-2.0/lib/Apache Status.pm

2003-01-27 Thread stas
stas2003/01/27 20:53:15

  Modified:lib/Apache Status.pm
  Log:
  - CGI.pm's script_name() appears to be broken, use $r-location instead
  - handle gracefully the stash dump for a child that doesn't have that
  stash
  
  Revision  ChangesPath
  1.2   +15 -12modperl-2.0/lib/Apache/Status.pm
  
  Index: Status.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/Status.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Status.pm 25 Jan 2003 13:26:11 -  1.1
  +++ Status.pm 28 Jan 2003 04:53:15 -  1.2
  @@ -312,7 +312,6 @@
   my($r, $q) = @_;
   
   my($name, $type) = (split /, $r-uri)[-2,-1];
  -my $script = $q-script_name;
   
   no strict 'refs';
   my @retval = Data Dump of $name $type pre\n;
  @@ -336,17 +335,21 @@
   
   no strict 'refs';
   my($name, $type) = (split /, $r-uri)[-2,-1];
  +# could be another child, which doesn't have this symbol table?
  +return unless *$name{CODE}; 
  +
   my @retval = Subroutine info for b$name/b pre\n;
  -my $script = $q-script_name;
   my $obj= B::svref_2object(*$name{CODE});
   my $file   = cv_file($obj);
   my $stash  = $obj-GV-STASH-NAME;
  +my $script = $r-location;
   
   push @retval, File: , 
   (-e $file ? qq(a href=file:$file$file/a) : $file), \n;
   
   my $cv= $obj-GV-CV;
   my $proto = $cv-PV if $cv-can('PV');
  +
   push @retval, qq(Package: a href=$script?$stash$stash/a\n);
   push @retval, Line: ,  $obj-GV-LINE, \n;
   push @retval, Prototype: , $proto || none, \n;
  @@ -376,7 +379,7 @@
   return unless eval { require B::Graph };
   
   B::Graph-UNIVERSAL::VERSION('0.03');
  -my $script = $q-script_name;
  +my $script = $r-location;
   return qq(\na href=$script/$name?noh_b_graphOP Tree Graph/a\n);
   }
   
  @@ -386,7 +389,7 @@
   return unless status_config($r, StatusLexInfo);
   return unless eval { require B::LexInfo };
   
  -my $script = $q-script_name;
  +my $script = $q-location;
   return qq(\na href=$script/$name?noh_b_lexinfoLexical Info/a\n);
   }
   
  @@ -411,7 +414,7 @@
   return unless status_config($r, StatusTerse);
   return unless eval { require B::Terse };
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   my @retval;
   for (qw(exec slow)) {
my $exp = $b_terse_exp{$_} order;
  @@ -440,7 +443,7 @@
   return unless status_config($r, StatusTerseSize);
   return unless eval { require B::TerseSize };
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   my @retval;
   for (qw(exec slow)) {
my $exp = $b_terse_exp{$_} order;
  @@ -471,7 +474,7 @@
   return unless status_config($r, StatusPackageSize);
   return unless eval { require B::TerseSize };
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   qq(a href=$script/$name?noh_b_package_sizeMemory Usage/a\n);
   }
   
  @@ -485,7 +488,7 @@
   
   no strict 'refs';
   my($package) = (split /, $r-uri)[-1];
  -my $script = $q-script_name;
  +my $script = $r-location;
   $r-print(Memory Usage for package $package\n\n);
   my($subs, $opcount, $opsize) = B::TerseSize::package_size($package);
   $r-print(Totals: $opsize bytes | $opcount OPs\n\n);
  @@ -525,7 +528,7 @@
   return unless eval { require B::Deparse };
   return unless $B::Deparse::VERSION = 0.59;
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   return qq(\na href=$script/$name?noh_b_deparseDeparse/a\n);
   }
   
  @@ -549,7 +552,7 @@
   return unless eval { require B::Fathom };
   return unless $B::Fathom::VERSION = 0.05;
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   return qq(\na href=$script/$name?noh_b_fathomFathom Score/a\n);
   }
   
  @@ -571,7 +574,7 @@
   return unless status_config($r, StatusPeek);
   return unless $is_installed{Apache::Peek};
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   return qq(\na href=$script/$name/$type?noh_peekPeek Dump/a\n);
   }
   
  @@ -592,7 +595,7 @@
   
   return unless $is_installed{B::Xref};
   
  -my $script = $q-script_name;
  +my $script = $r-location;
   return qq(\na href=$script/$name?noh_xrefCross Reference Report/a\n);
   }
   
  
  
  



cvs commit: modperl-2.0/lib/Apache Status.pm

2003-01-25 Thread stas
stas2003/01/25 05:26:11

  Added:   lib/Apache Status.pm
  Log:
  started porting Apache::Status to 2.0:
  - adjust style
  - use mod_perl 2.0 api (trying to get away from using compat.pm)
  - adjust the 'registry scripts' logic to work with the new registry cache
  (present scripts by the handler they are compiled in)
  
  Revision  ChangesPath
  1.1  modperl-2.0/lib/Apache/Status.pm
  
  Index: Status.pm
  ===
  package Apache::Status;
  
  use strict;
  #use warnings; #XXX FATAL = 'all'; 
  no warnings; # 'redefine';
  
  # XXX: something is wrong with bleadperl, it warns about redefine
  # warnings, when no warnings 'redefine' is set (test with 5.8.0). even
  # when used with 'no warnings' it still barks on redefinining the
  # constants
  
  
  
  # XXX
  # use mod_perl 2.0;
  
  use Apache::RequestRec ();
  use Apache::RequestUtil ();
  use Apache::ServerUtil ();
  
  $Apache::Status::VERSION = '3.00'; # mod_perl 2.0
  
  use constant IS_WIN32 = ($^O eq MSWin32);
  my $Is_Win32 = ($^O eq MSWin32);
  
  my %is_installed = ();
  {
  local $SIG{__DIE__};
  %is_installed = map {
$_, (eval(require $_) || 0);
  } qw (Data::Dumper Devel::Symdump B Apache::Request 
  Apache::Peek Apache::Symbol);
  }
  
  our $newQ;
  
  if ($is_installed{Apache::Request}) {
  $newQ ||= sub { Apache::Request-new(@_) };
  }
  else {
  $is_installed{CGI} = eval(require CGI) || 0;
  $newQ ||= sub { CGI-new; };
  }
  
  my $CPAN_base = http://cpan.org/modules/by-module/;;
  
  my $install_symdump = EOF;
  Please install the a href=$CPAN_base/Devel/Devel::Symdump/a module.
  EOF
  
  my %status = (
  script= PerlRequire'd Files,
  inc   = Loaded Modules,
  rgysubs   = Compiled Registry Scripts,
  'symdump' = Symbol Table Dump,
  inh_tree  = Inheritance Tree,
  isa_tree  = ISA Tree,  
  env   = Environment,
  sig   = Signal Handlers,
  myconfig  = Perl Configuration,
  hooks = Enabled mod_perl Hooks,
  );
  
  delete $status{'hooks'} if $mod_perl::VERSION = 1.9901;
  delete $status{'sig'} if IS_WIN32;
  
  # XXX: needs porting
  if ($Apache::Server::SaveConfig) {
  $status{section_config} = Perl Section Configuration;
  }
  
  sub menu_item {
  my($self, $key, $val, $sub) = @_;
  $status{$key} = $val;
  no strict;
  *{status_${key}} = $sub if $sub and ref $sub eq 'CODE';
  }
  
  sub handler {
  my($r) = @_;
  Apache-request($r); #for Apache::CGI
  my $qs = $r-args || ;
  my $sub = status_$qs;
  no strict 'refs';
  
  if ($qs =~ s/^(noh_\w+).*/$1/) {
return {$qs}($r, $newQ-($r));
  }
  
  header($r);
  if (defined $sub) {
$r-print(@{ {$sub}($r, $newQ-($r)) });
  }
  elsif ($qs and %{$qs.::}) {
$r-print(symdump($r, $newQ-($r), $qs));
  }
  else {
my $uri = $r-uri;
$r-print(
map { qq[a href=$uri?$_$status{$_}/abr\n] } keys %status
  );
  }
  $r-print(/body/html);
  
  1;
  }
  
  sub header {
  my $r = shift;
  my $start = scalar localtime $^T;
  my $srv = Apache::get_server_version();
  $r-content_type(text/html);
  my $v = $^V ? sprintf v%vd, $^V : $];
  $r-print(EOF);
  html
  headtitleApache::Status/title/head
  body
  Embedded Perl version b$v/b for b$srv/b process b$$/b, 
  br running since $starthr
  EOF
  
  }
  
  sub symdump {
  my($r, $q, $package) = @_;
  
  return $install_symdump unless $is_installed{Devel::Symdump};
  
  my $meth = new;
  $meth = rnew if lc($r-dir_config(StatusRdump)) eq on;
  my $sob = Devel::Symdump-$meth($package);
  return $sob-Apache::Status::as_HTML($package, $r, $q);
  }
  
  sub status_symdump {
  my($r, $q) = @_;
  [symdump($r, $q, 'main')];
  }
  
  sub status_section_config {
  my($r, $q) = @_;
  require Apache::PerlSections;
  [pre, Apache::PerlSections-dump, /pre];
  }
  
  sub status_hooks {
  my($r, $q) = @_;
  # XXX: hooks list access doesn't exist yet in 2.0
  require mod_perl;
  require mod_perl_hooks;
  my @retval = qw(table);
  my @list = mod_perl::hooks();
  for my $hook (sort @list) {
my $on_off = 
  mod_perl::hook($hook) ? bEnabled/b : iDisabled/i;
push @retval, trtd$hook/tdtd$on_off/td/tr\n;
  }
  push @retval, qw(/table);
  \@retval;
  }
  
  sub status_inc {
  my($r, $q) = @_;
  
  my $uri = $r-uri;
  my @retval = (
  table border=1,
  tr, 
  (map tdb$_/b/td, qw(Package Version Modified File)),
  /tr\n
  );
  
  foreach my $file (sort keys %INC) {
local $^W = 0;
next if $file =~ m:^/:;
next unless $file =~ m:\.pm:;
next unless $INC{$file}; #e.g. fake Apache/TieHandle.pm
  
no strict 'refs';
(my $module = $file

cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-22 Thread stas
stas2003/01/22 16:31:28

  Modified:src/modules/perl mod_perl.c mod_perl.h modperl_filter.c
modperl_util.h
   .Changes
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/Apache/SubRequest Apache__SubRequest.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  - add a new MP_FAILURE_CROAK macro to handle failures
  - all response functions are now returning status and the callers check
  and croak on failure or progate them further.
  
  Revision  ChangesPath
  1.147 +10 -4 modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.146
  retrieving revision 1.147
  diff -u -r1.146 -r1.147
  --- mod_perl.c12 Jan 2003 02:15:58 -  1.146
  +++ mod_perl.c23 Jan 2003 00:31:28 -  1.147
  @@ -709,12 +709,12 @@
   wb-r = r;
   }
   
  -void modperl_response_finish(request_rec *r)
  +apr_status_t modperl_response_finish(request_rec *r)
   {
   MP_dRCFG;
   
   /* flush output buffer */
  -modperl_wbucket_flush(rcfg-wbucket);
  +return modperl_wbucket_flush(rcfg-wbucket);
   }
   
   static int modperl_response_handler_run(request_rec *r, int finish)
  @@ -730,7 +730,10 @@
   }
   
   if (finish) {
  -modperl_response_finish(r);
  +apr_status_t rc = modperl_response_finish(r);
  +if (rc != APR_SUCCESS) {
  +retval = rc;
  +}
   }
   
   return retval;
  @@ -803,7 +806,10 @@
   #endif
   
   /* flush output buffer after interpreter is putback */
  -modperl_response_finish(r);
  +apr_status_t rc = modperl_response_finish(r);
  +if (rc != APR_SUCCESS) {
  +retval = rc;
  +}
   
   switch (rcfg-status) {
 case HTTP_MOVED_TEMPORARILY:
  
  
  
  1.56  +1 -1  modperl-2.0/src/modules/perl/mod_perl.h
  
  Index: mod_perl.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.h,v
  retrieving revision 1.55
  retrieving revision 1.56
  diff -u -r1.55 -r1.56
  --- mod_perl.h12 Dec 2002 10:05:08 -  1.55
  +++ mod_perl.h23 Jan 2003 00:31:28 -  1.56
  @@ -88,7 +88,7 @@
   void xs_init(pTHX);
   
   void modperl_response_init(request_rec *r);
  -void modperl_response_finish(request_rec *r);
  +apr_status_t modperl_response_finish(request_rec *r);
   int modperl_response_handler(request_rec *r);
   int modperl_response_handler_cgi(request_rec *r);
   
  
  
  
  1.45  +5 -6  modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- modperl_filter.c  17 Jan 2003 03:08:31 -  1.44
  +++ modperl_filter.c  23 Jan 2003 00:31:28 -  1.45
  @@ -23,6 +23,8 @@
   ap_log_error(APLOG_MARK, APLOG_WARNING,
0, r-server, %s did not send an HTTP header,
r-uri);
  +/* XXX: bodytext == NULL here */
  +return status;
   }
   else if (!bodytext) {
   return APR_SUCCESS;
  @@ -190,17 +192,14 @@
* first modperl_input_filter_read, so it must be
* destroyed at the end of the filter invocation
*/
  -/* XXX: may be the filter must consume all the data? add a
  - * test to check */
   apr_brigade_destroy(filter-bb_in);
   filter-bb_in = NULL;
   }
  -modperl_input_filter_flush(filter);
  +MP_FAILURE_CROAK(modperl_input_filter_flush(filter));
   }
   else {
  -modperl_output_filter_flush(filter);
  +MP_FAILURE_CROAK(modperl_output_filter_flush(filter));
   }
  -
   
   return status;
   }
  @@ -457,7 +456,7 @@
   
   if (filter-flush  len == 0) {
   /* if len  0 then $filter-write will flush */
  -modperl_output_filter_flush(filter);
  +MP_FAILURE_CROAK(modperl_output_filter_flush(filter));
   }
   
   return len;
  
  
  
  1.38  +7 -0  modperl-2.0/src/modules/perl/modperl_util.h
  
  Index: modperl_util.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.h,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- modperl_util.h11 Jan 2003 00:02:16 -  1.37
  +++ modperl_util.h23 Jan 2003 00:31:28 -  1.38
  @@ -50,6 +50,13 @@
   #define MP_magical_tie(sv, mg_flags) \
   SvFLAGS((SV*)sv) |= mg_flags
   
  +#define

cvs commit: modperl-2.0 Makefile.PL Changes

2003-01-22 Thread stas
stas2003/01/22 21:16:30

  Modified:.Makefile.PL Changes
  Log:
  the top level 'make test' now descends into the ModPerl-Registry dir
  to run 'make test' there
  
  Revision  ChangesPath
  1.90  +24 -1 modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.89
  retrieving revision 1.90
  diff -u -r1.89 -r1.90
  --- Makefile.PL   11 Jan 2003 03:20:54 -  1.89
  +++ Makefile.PL   23 Jan 2003 05:16:30 -  1.90
  @@ -29,7 +29,6 @@
   use Apache::TestReportPerl ();
   use Apache::TestSmokePerl ();
   use Apache::TestTrace;
  -use Apache::TestMM qw(test);
   use ModPerl::TestRun ();
   use ModPerl::Code ();
   use ModPerl::MM ();
  @@ -442,6 +441,30 @@
   ModPerl::MM::add_dep(\$string, clean = 'modperl_src_clean');
   ModPerl::MM::add_dep(\$string, clean = 'test_clean');
   $string;
  +}
  +
  +sub MY::test {
  +
  +my $env = Apache::TestConfig-passenv_makestr();
  +
  +my $preamble = Apache::TestConfig::WIN32 ?  : EOF;
  +PASSENV = $env
  +EOF
  +
  +return $preamble . 'EOF';
  +test_clean :
  + $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
  + t/TEST -clean
  + 
  +run_tests : test_clean
  + $(PASSENV) \
  + $(FULLPERL) -I$(INST_ARCHLIB) -I$(INST_LIB) \
  + t/TEST
  + cd ModPerl-Registry  make test
  +
  +test :: pure_all run_tests test_clean
  +EOF
  +
   }
   
   sub MY::postamble {
  
  
  
  1.112 +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.111
  retrieving revision 1.112
  diff -u -r1.111 -r1.112
  --- Changes   23 Jan 2003 04:06:38 -  1.111
  +++ Changes   23 Jan 2003 05:16:30 -  1.112
  @@ -10,6 +10,9 @@
   
   =item 1.99_09-dev
   
  +the top level 'make test' now descend into the ModPerl-Registry dir
  +to run 'make test' there [Stas]
  +
   Apache::Test: don't inherit loading of the mod_perl object from the
   system-wide config, since we already add it [Stas]
   
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-21 Thread stas
stas2003/01/21 19:19:43

  Modified:.Changes
   src/modules/perl modperl_io.c modperl_io.h
   t/modperl .cvsignore
   todo api.txt
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/maps  modperl_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Added:   t/response/TestModperl request_rec_tie_api.pm
  Log:
  - expose useful macros from modperl_io.c via modperl_io.h
  - add $r-FILENO implementation
  - add a test
  
  Revision  ChangesPath
  1.107 +2 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.106
  retrieving revision 1.107
  diff -u -r1.106 -r1.107
  --- Changes   20 Jan 2003 07:54:52 -  1.106
  +++ Changes   22 Jan 2003 03:19:43 -  1.107
  @@ -10,6 +10,8 @@
   
   =item 1.99_09-dev
   
  +Add $r-FILENO implementation [Stas]
  +
   Apache::Test: Support NoAutoConfig /NoAutoConfig blocks in .pm
   files, so we can have a full manual control over generated config
   sections. These sections are fully parsed and variables are
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/request_rec_tie_api.pm
  
  Index: request_rec_tie_api.pm
  ===
  package TestModperl::request_rec_tie_api;
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::RequestIO ();
  
  use Apache::Test;
  use Apache::TestUtil;
  
  use Apache::Const -compile = 'OK';
  
  sub handler {
  my $r = shift;
  
  plan $r, tests = 1;
  
  ok t_cmp(fileno(STDOUT), $r-FILENO(), FILENO);
  
  return Apache::OK;
  }
  
  1;
  
  
  
  1.9   +0 -13 modperl-2.0/src/modules/perl/modperl_io.c
  
  Index: modperl_io.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- modperl_io.c  24 Mar 2002 02:41:29 -  1.8
  +++ modperl_io.c  22 Jan 2003 03:19:43 -  1.9
  @@ -1,18 +1,5 @@
   #include mod_perl.h
   
  -/*
  - * bleedperl change #11639 switch tied handle magic
  - * from living in the gv to the GvIOp(gv), so we have to deal
  - * with both to support 5.6.x
  - */
  -#if ((PERL_REVISION == 5)  (PERL_VERSION = 7))
  -#   define TIEHANDLE_SV(handle) (SV*)GvIOp((SV*)handle)
  -#else
  -#   define TIEHANDLE_SV(handle) (SV*)handle
  -#endif
  -
  -#define dHANDLE(name) GV *handle = gv_fetchpv(name, TRUE, SVt_PVIO)
  -
   #define TIEHANDLE(handle,r) \
   modperl_io_handle_tie(aTHX_ handle, Apache::RequestRec, (void *)r)
   
  
  
  
  1.2   +13 -0 modperl-2.0/src/modules/perl/modperl_io.h
  
  Index: modperl_io.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_io.h,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- modperl_io.h  5 May 2001 22:06:41 -   1.1
  +++ modperl_io.h  22 Jan 2003 03:19:43 -  1.2
  @@ -1,6 +1,19 @@
   #ifndef MODPERL_IO_H
   #define MODPERL_IO_H
   
  +/*
  + * bleedperl change #11639 switch tied handle magic
  + * from living in the gv to the GvIOp(gv), so we have to deal
  + * with both to support 5.6.x
  + */
  +#if ((PERL_REVISION == 5)  (PERL_VERSION = 7))
  +#   define TIEHANDLE_SV(handle) (SV*)GvIOp((SV*)handle)
  +#else
  +#   define TIEHANDLE_SV(handle) (SV*)handle
  +#endif
  +
  +#define dHANDLE(name) GV *handle = gv_fetchpv(name, TRUE, SVt_PVIO)
  +
   #define IoFLUSH_off(gv) \
   IoFLAGS(GvIOp((gv))) = ~IOf_FLUSH
   
  
  
  
  1.11  +1 -0  modperl-2.0/t/modperl/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/modperl/.cvsignore,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- .cvsignore22 Oct 2002 15:13:22 -  1.10
  +++ .cvsignore22 Jan 2003 03:19:43 -  1.11
  @@ -10,3 +10,4 @@
   methodobj.t
   method.t
   setauth.t
  +request_rec_tie_api.t
  
  
  
  1.30  +1 -1  modperl-2.0/todo/api.txt
  
  Index: api.txt
  ===
  RCS file: /home/cvs/modperl-2.0/todo/api.txt,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- api.txt   6 Dec 2002 16:19:36 -   1.29
  +++ api.txt   22 Jan 2003 03:19:43 -  1.30
  @@ -3,7 +3,7 @@
   --
   
   tied filehandle interface:
  - -CLOSE, OPEN, EOF, TELL, SEEK, FILENO
  + -CLOSE, OPEN, EOF, TELL, SEEK
-READLINE - proper implementation (see comment in Apache::compat)
   
   $r-finfo:
  
  
  
  1.31  +7 -0  modperl-2.0/xs/Apache/RequestIO

cvs commit: modperl-2.0/t/error push_handlers.t

2003-01-21 Thread stas
stas2003/01/21 23:00:29

  Modified:t/error  push_handlers.t
  Log:
  use the new under_construction test to print a descriptive skip reason
  
  Revision  ChangesPath
  1.3   +1 -1  modperl-2.0/t/error/push_handlers.t
  
  Index: push_handlers.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/error/push_handlers.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- push_handlers.t   21 Jan 2003 06:30:23 -  1.2
  +++ push_handlers.t   22 Jan 2003 07:00:29 -  1.3
  @@ -7,7 +7,7 @@
   
   # XXX: the misuse of push_handlers exercised by this test is different
   # at least on FreeBSD, so it fails, skip for now.
  -plan tests = 1, have { ignore = sub { 0 } };
  +plan tests = 1, under_construction;
   
   my $location = /TestError::push_handlers;
   my $expected = ok;
  
  
  



cvs commit: modperl-2.0 Changes

2003-01-21 Thread stas
stas2003/01/21 23:02:14

  Modified:.Changes
  Log:
  log the recent changes
  
  Revision  ChangesPath
  1.109 +5 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.108
  retrieving revision 1.109
  diff -u -r1.108 -r1.109
  --- Changes   22 Jan 2003 06:12:42 -  1.108
  +++ Changes   22 Jan 2003 07:02:14 -  1.109
  @@ -10,6 +10,11 @@
   
   =item 1.99_09-dev
   
  +Apache::Test: support two new shortcuts for skip functionality:
  + - have_threads: checks whether both Apache and Perl support threads
  + - under_construction: to print a consistent/clear skip reason
  +[Stas]
  +
   OPEN, CLOSE and FILENO implementation for Apache::RequestRec [Stas]
   
   Apache::Test: Support NoAutoConfig /NoAutoConfig blocks in .pm
  
  
  



cvs commit: modperl-2.0/t/filter .cvsignore

2003-01-20 Thread stas
stas2003/01/20 15:14:40

  Modified:t/filter .cvsignore
  Log:
  adjust the ignore list
  
  Revision  ChangesPath
  1.4   +2 -5  modperl-2.0/t/filter/.cvsignore
  
  Index: .cvsignore
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/.cvsignore,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- .cvsignore25 Nov 2002 22:46:29 -  1.3
  +++ .cvsignore20 Jan 2003 23:14:40 -  1.4
  @@ -1,6 +1,3 @@
  -api.t
  -buckets.t
  -input_body.t
  -input_msg.t
  -lc.t
  +out_bbs_basic.t
  +out_str_api.t
   
  
  
  



cvs commit: modperl-2.0/t/error push_handlers.t

2003-01-20 Thread stas
stas2003/01/20 22:30:23

  Modified:t/error  push_handlers.t
  Log:
  disable this test for now:
   the misuse of push_handlers exercised by this test is different
  at least on FreeBSD, so it fails, skip for now.
  
  Revision  ChangesPath
  1.2   +3 -1  modperl-2.0/t/error/push_handlers.t
  
  Index: push_handlers.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/error/push_handlers.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- push_handlers.t   14 Jan 2003 06:42:44 -  1.1
  +++ push_handlers.t   21 Jan 2003 06:30:23 -  1.2
  @@ -5,7 +5,9 @@
   use Apache::TestUtil;
   use Apache::TestRequest;
   
  -plan tests = 1;
  +# XXX: the misuse of push_handlers exercised by this test is different
  +# at least on FreeBSD, so it fails, skip for now.
  +plan tests = 1, have { ignore = sub { 0 } };
   
   my $location = /TestError::push_handlers;
   my $expected = ok;
  
  
  



cvs commit: modperl-2.0/t/response/TestAPR threadmutex.pm

2003-01-20 Thread stas
stas2003/01/20 22:54:22

  Modified:t/response/TestAPR threadmutex.pm
  Log:
  fix the plan skip condition, which wasn't skipping the test before
  
  Revision  ChangesPath
  1.3   +1 -1  modperl-2.0/t/response/TestAPR/threadmutex.pm
  
  Index: threadmutex.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/threadmutex.pm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- threadmutex.pm23 Jun 2002 22:14:26 -  1.2
  +++ threadmutex.pm21 Jan 2003 06:54:22 -  1.3
  @@ -12,7 +12,7 @@
   sub handler {
   my $r = shift;
   
  -plan $r, tests = 3, 'APR::ThreadMutex';
  +plan $r, tests = 3, have 'APR::ThreadMutex';
   
   require APR::ThreadMutex;
   
  
  
  



cvs commit: modperl-2.0/t/preconnection/TestPreConnection - New directory

2003-01-19 Thread stas
stas2003/01/19 23:55:35

  modperl-2.0/t/preconnection/TestPreConnection - New directory



cvs commit: modperl-2.0/t/preconnection/TestPreConnection note.pm

2003-01-19 Thread stas
stas2003/01/19 23:56:17

  Added:   t/preconnection note.t
   t/preconnection/TestPreConnection note.pm
  Log:
  add a simple test to verify that PreConnection handlers are working
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/preconnection/note.t
  
  Index: note.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  my $module = TestPreConnection::note;
  Apache::TestRequest::module($module);
  my $hostport = Apache::TestRequest::hostport(Apache::Test::config());
  my $location = http://$hostport/$module;;
  t_debug(connecting to $location);
  plan tests = 1;
  
  ok t_cmp(
  'ok', 
  GET_BODY($location),
  connection notes);
  
  
  
  1.1  modperl-2.0/t/preconnection/TestPreConnection/note.pm
  
  Index: note.pm
  ===
  package TestPreConnection::note;
  
  use strict;
  use warnings;# FATAL = 'all';
  
  use Apache::Connection ();
  
  use Apache::Const -compile = qw(OK);
  
  sub handler {
  my Apache::Connection $c = shift;
  
  $c-notes-set(preconnection = 'ok');
  
  return Apache::OK;
  }
  
  use constant BUFF_LEN = 1024;
  
  sub response {
  my $r = shift;
  
  $r-content_type('text/plain');
  $r-print($r-connection-notes-get('preconnection') || '');
  
  return Apache::OK
  }
  
  1;
  __END__
  NoAutoConfig
VirtualHost TestPreConnection::note
  PerlPreConnectionHandler TestPreConnection::note

  Location /TestPreConnection::note
SetHandler modperl
PerlResponseHandler TestPreConnection::note::response
  /Location
/VirtualHost
  /NoAutoConfig
  
  
  
  
  



cvs commit: modperl-2.0/t/preconnection/TestPreConnection note.pm

2003-01-19 Thread stas
stas2003/01/19 23:59:44

  Modified:t/preconnection/TestPreConnection note.pm
  Log:
  cleanup
  
  Revision  ChangesPath
  1.2   +1 -3  modperl-2.0/t/preconnection/TestPreConnection/note.pm
  
  Index: note.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/preconnection/TestPreConnection/note.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- note.pm   20 Jan 2003 07:56:17 -  1.1
  +++ note.pm   20 Jan 2003 07:59:44 -  1.2
  @@ -1,7 +1,7 @@
   package TestPreConnection::note;
   
   use strict;
  -use warnings;# FATAL = 'all';
  +use warnings FATAL = 'all';
   
   use Apache::Connection ();
   
  @@ -14,8 +14,6 @@
   
   return Apache::OK;
   }
  -
  -use constant BUFF_LEN = 1024;
   
   sub response {
   my $r = shift;
  
  
  



cvs commit: modperl-2.0 Changes

2003-01-17 Thread stas
stas2003/01/17 17:59:22

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
   .Changes
  Log:
  Another fix for the handling of the return status in
  ModPerl::RegistryCooker: reset the status to the original one only if
  it was changed by the script, otherwise return the execution status
  
  Revision  ChangesPath
  1.28  +6 -2  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- RegistryCooker.pm 6 Jan 2003 10:42:38 -   1.27
  +++ RegistryCooker.pm 18 Jan 2003 01:59:21 -  1.28
  @@ -163,9 +163,13 @@
   # handlers shouldn't set $r-status but return it
   my $old_status = $self-[REQ]-status;
   my $rc = $self-run;
  -$self-[REQ]-status($old_status);
  +my $new_status = $self-[REQ]-status;
   
  -return ($rc != Apache::OK) ? $rc : $self-[STATUS];
  +# only if the script has changed the status, reset to the old
  +# status and return the new status
  +return $old_status != $new_status 
  +? $self-[REQ]-status($old_status)
  +: $rc;
   }
   
   #
  
  
  
  1.105 +5 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.104
  retrieving revision 1.105
  diff -u -r1.104 -r1.105
  --- Changes   17 Jan 2003 03:23:24 -  1.104
  +++ Changes   18 Jan 2003 01:59:22 -  1.105
  @@ -10,6 +10,11 @@
   
   =item 1.99_09-dev
   
  +Another fix for the handling of the return status in
  +ModPerl::RegistryCooker: reset the status to the original one only if
  +it was changed by the script, otherwise return the execution status
  +[Stas]
  +
   prevent segfault in $r-print / $filter-print (in output filter) and
   related functions when they are called before the response phase
   [Stas]
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm

2003-01-17 Thread stas
stas2003/01/17 18:04:32

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  apparently there is not much use for the return status of eval
  
  Revision  ChangesPath
  1.29  +3 -6  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- RegistryCooker.pm 18 Jan 2003 01:59:21 -  1.28
  +++ RegistryCooker.pm 18 Jan 2003 02:04:32 -  1.29
  @@ -64,7 +64,6 @@
   use constant MTIME = 3;
   use constant PACKAGE   = 4;
   use constant CODE  = 5;
  -use constant STATUS= 6;
   
   #
   # OS specific constants
  @@ -189,15 +188,13 @@
   $self-set_script_name;
   $self-chdir_file;
   
  -my $rc = Apache::OK;
   my $cv = \{$package\::handler};
   
   my %orig_inc = %INC;
   
   { # run the code and preserve warnings setup when it's done
   no warnings;
  -eval { $rc = $cv-($r, @_) };
  -$self-[STATUS] = $rc;
  +eval { $cv-($r, @_) };
   ModPerl::Global::special_list_call(END = $package);
   }
   
  @@ -212,8 +209,8 @@
   
   #XXX: $self-chdir_file($Apache::Server::CWD/);
   
  -if ( ($rc = $self-error_check) != Apache::OK) {
  -return $rc;
  +if ( (my $err_rc = $self-error_check) != Apache::OK) {
  +return $err_rc;
   }
   
   return Apache::OK;
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-16 Thread stas
stas2003/01/16 18:26:32

  Modified:.Changes
   xs/Apache/Response Apache__Response.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  fix segfault in send_http_header when it's called before the response
  phase
  
  Revision  ChangesPath
  1.102 +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.101
  retrieving revision 1.102
  diff -u -r1.101 -r1.102
  --- Changes   16 Jan 2003 02:38:09 -  1.101
  +++ Changes   17 Jan 2003 02:26:31 -  1.102
  @@ -10,6 +10,9 @@
   
   =item 1.99_09-dev
   
  +fix segfault in send_http_header when it's called before the response
  +phase [Stas]
  +
   input stream filtering support was added + tests (plus renaming filter
   tests so we can know from the test name what kind of filter is tested)
   [Stas]
  
  
  
  1.8   +11 -2 modperl-2.0/xs/Apache/Response/Apache__Response.h
  
  Index: Apache__Response.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Response/Apache__Response.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Apache__Response.h19 May 2002 23:01:12 -  1.7
  +++ Apache__Response.h17 Jan 2003 02:26:31 -  1.8
  @@ -15,7 +15,8 @@
   
   /* XXX: should only be part of Apache::compat */
   static MP_INLINE void
  -mpxs_Apache__RequestRec_send_http_header(request_rec *r, const char *type)
  +mpxs_Apache__RequestRec_send_http_header(pTHX_ request_rec *r,
  + const char *type)
   {
   MP_dRCFG;
   
  @@ -23,7 +24,15 @@
   ap_set_content_type(r, apr_pstrdup(r-pool, type));
   }
   
  -rcfg-wbucket-header_parse = 0; /* turn off PerlOptions +ParseHeaders */
  +if (rcfg-wbucket) {
  +/* turn off PerlOptions +ParseHeaders */
  +rcfg-wbucket-header_parse = 0; 
  +}
  +else {
  +/* the response is not initialized yet */
  +Perl_croak(aTHX_ send_http_header() can't be called before 
  +   the response phase);
  +}
   }
   
   static MP_INLINE void
  
  
  
  1.95  +4 -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.94
  retrieving revision 1.95
  diff -u -r1.94 -r1.95
  --- FunctionTable.pm  15 Jan 2003 06:07:10 -  1.94
  +++ FunctionTable.pm  17 Jan 2003 02:26:32 -  1.95
  @@ -5370,6 +5370,10 @@
   'name' = 'mpxs_Apache__RequestRec_send_http_header',
   'args' = [
 {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
   'type' = 'request_rec *',
   'name' = 'r'
 },
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-16 Thread stas
stas2003/01/16 19:08:31

  Modified:src/modules/perl modperl_filter.c modperl_filter.h
   .Changes
   xs   modperl_xs_util.h
   xs/Apache/RequestIO Apache__RequestIO.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  prevent segfault in $r-print / $filter-print (in output filter) and
  related functions when they are called before the response phase
  
  Revision  ChangesPath
  1.44  +11 -4 modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -r1.43 -r1.44
  --- modperl_filter.c  15 Jan 2003 06:07:10 -  1.43
  +++ modperl_filter.c  17 Jan 2003 03:08:31 -  1.44
  @@ -55,13 +55,18 @@
   return rv;
   }
   
  -MP_INLINE apr_status_t modperl_wbucket_write(modperl_wbucket_t *wb,
  +MP_INLINE apr_status_t modperl_wbucket_write(pTHX_ modperl_wbucket_t *wb,
const char *buf,
apr_size_t *wlen)
   {
   apr_size_t len = *wlen;
   *wlen = 0;
   
  +if (!wb) {
  +/* the response is not initialized yet */
  +Perl_croak(aTHX_ can't be called before the response phase);
  +}
  +
   if ((len + wb-outcnt)  sizeof(wb-outbuf)) {
   apr_status_t rv;
   if ((rv = modperl_wbucket_flush(wb)) != APR_SUCCESS) {
  @@ -505,7 +510,8 @@
   return filter-rc;
   }
   
  -MP_INLINE apr_status_t modperl_input_filter_write(modperl_filter_t *filter,
  +MP_INLINE apr_status_t modperl_input_filter_write(pTHX_
  +  modperl_filter_t *filter,
 const char *buf,
 apr_size_t *len)
   {
  @@ -519,11 +525,12 @@
   return APR_SUCCESS;
   }
   
  -MP_INLINE apr_status_t modperl_output_filter_write(modperl_filter_t *filter,
  +MP_INLINE apr_status_t modperl_output_filter_write(pTHX_
  +   modperl_filter_t *filter,
  const char *buf,
  apr_size_t *len)
   {
  -return modperl_wbucket_write(filter-wbucket, buf, len);
  +return modperl_wbucket_write(aTHX_ filter-wbucket, buf, len);
   }
   
   apr_status_t modperl_output_filter_handler(ap_filter_t *f,
  
  
  
  1.17  +6 -3  modperl-2.0/src/modules/perl/modperl_filter.h
  
  Index: modperl_filter.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.h,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- modperl_filter.h  15 Jan 2003 06:07:10 -  1.16
  +++ modperl_filter.h  17 Jan 2003 03:08:31 -  1.17
  @@ -16,7 +16,8 @@
   
   MP_INLINE apr_status_t modperl_wbucket_flush(modperl_wbucket_t *b);
   
  -MP_INLINE apr_status_t modperl_wbucket_write(modperl_wbucket_t *b,
  +MP_INLINE apr_status_t modperl_wbucket_write(pTHX_
  + modperl_wbucket_t *b,
const char *buf,
apr_size_t *wlen);
   
  @@ -50,7 +51,8 @@
   SV *buffer,
   apr_size_t wanted);
   
  -MP_INLINE apr_status_t modperl_output_filter_write(modperl_filter_t *filter,
  +MP_INLINE apr_status_t modperl_output_filter_write(pTHX_
  +   modperl_filter_t *filter,
  const char *buf,
  apr_size_t *len);
   
  @@ -75,7 +77,8 @@
  SV *buffer,
  apr_size_t wanted);
   
  -MP_INLINE apr_status_t modperl_input_filter_write(modperl_filter_t *filter,
  +MP_INLINE apr_status_t modperl_input_filter_write(pTHX_
  +  modperl_filter_t *filter,
 const char *buf,
 apr_size_t *len);
   
  
  
  
  1.103 +5 -2  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.102
  retrieving revision 1.103
  diff -u -r1.102 -r1.103
  --- Changes   17 Jan 2003 02:26:31 -  1.102
  +++ Changes   17 Jan 2003 03:08:31 -  1.103
  @@ -10,8 +10,11 @@
   
   =item 1.99_09-dev
   
  -fix

cvs commit: modperl-2.0 Changes

2003-01-15 Thread stas
stas2003/01/15 18:38:09

  Modified:.Changes
  Log:
  log the recent changes
  
  Revision  ChangesPath
  1.101 +14 -2 modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.100
  retrieving revision 1.101
  diff -u -r1.100 -r1.101
  --- Changes   14 Jan 2003 06:42:44 -  1.100
  +++ Changes   16 Jan 2003 02:38:09 -  1.101
  @@ -10,9 +10,21 @@
   
   =item 1.99_09-dev
   
  -prevent a segfault when push_handlers are used to push a handler into
  -the currently phase and switching the handler (perl-script/modperl)
  +input stream filtering support was added + tests (plus renaming filter
  +tests so we can know from the test name what kind of filter is tested)
   [Stas]
  +
  +Add proper support for mis-behaved feeding filters that send more than
  +one EOS bucket in streaming filters + test. [Stas]
  +
  +implement a more robust autogenerated client .t test in
  +Apache::TestConfigPerl. Before this fix if the server side returned
  +500, the test would get skipped, not good. Now it will die a horrible
  +death. [Stas]
  +
  +prevent a segfault when push_handlers are used to push a handler into
  +the currently phase and switching the handler (perl-script/modperl) +
  +tests [Stas]
   
   Add $filter-seen_eos to the streaming filter api to know when eos has
   been seen, so special signatures can be passed and any data stored in
  
  
  



cvs commit: modperl-2.0/t/filter/TestFilter in_str_consume.pm

2003-01-15 Thread stas
stas2003/01/15 21:15:18

  Added:   t/filter in_str_consume.t
   t/filter/TestFilter in_str_consume.pm
  Log:
  add a faulty filter test, but keep the fault disabled for now
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/filter/in_str_consume.t
  
  Index: in_str_consume.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  plan tests = 1;
  
  my $location = '/TestFilter::in_str_consume';
  
  # send a message bigger than 8k, so to make sure that the input filter
  # will get more than one bucket brigade with data.
  my $data = A 22 chars long string x 500; # about 11k
  my $received = POST_BODY $location, content = $data;
  my $expected = read just the first 1024b from the first brigade;
  
  ok t_cmp($expected, $received, input stream filter partial consume)
  
  
  
  1.1  modperl-2.0/t/filter/TestFilter/in_str_consume.pm
  
  Index: in_str_consume.pm
  ===
  package TestFilter::in_str_consume;
  
  # this test verifies that streaming filters framework handles
  # gracefully the case when a filter doesn't print anything at all to
  # the caller. I figure it's absolutely doesn't matter if the incoming
  # bb from the upstream is consumed or not. What matter is that the
  # filter sends something downstream (an empty bb will do).
  #
  # e.g. a filter that cleans up the incoming stream (extra spaces?)
  # might reduce the whole bb into nothing (e.g. if it was made of only
  # white spaces) then it should send  down.
  #
  # another problem with not reading in the while() loop, is that the
  # eos bucket won't be detected by the streaming framework and
  # consequently won't be sent downstream, probably breaking other
  # filters who rely on receiving the EOS bucket.
  
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Filter ();
  
  use Apache::Const -compile = qw(OK M_POST);
  
  sub handler {
  my($filter, $bb, $mode, $block, $readbytes) = @_;
  
  my $ctx = $filter-ctx;
  
  unless ($ctx) {
  # read a bit from the first brigade and leave the second
  # brigade completely unconsumed. we assume that there are two
  # brigades because the core input filter will split data in
  # 8kb chunks per brigade and we have sent 11k of data (1st bb:
  # 8kb, 2nd bb: ~3kb)
  my $len = $filter-read($mode, $block, $readbytes, my $buffer, 1024);
  warn FILTER READ: $len bytes\n;
  $filter-print(read just the first 1024b from the first brigade);
  
  $filter-ctx(1);
  }
  else {
  unless ($filter-seen_eos) {
  # XXX: comment out the next line to reproduce the segfault
  $filter-print();
  }
  }
  
  return Apache::OK;
  }
  
  sub response {
  my $r = shift;
  
  $r-content_type('text/plain');
  
  if ($r-method_number == Apache::M_POST) {
  my $data = ModPerl::Test::read_post($r);
  #warn HANDLER READ: $data\n;
  $r-print($data);
  }
  
  return Apache::OK;
  }
  1;
  __DATA__
  SetHandler modperl
  PerlResponseHandler TestFilter::in_str_consume::response
  
  
  



cvs commit: modperl-2.0 STATUS

2003-01-14 Thread stas
stas2003/01/14 21:22:53

  Modified:.STATUS
  Log:
  an issue to resolve
  
  Revision  ChangesPath
  1.33  +8 -1  modperl-2.0/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/modperl-2.0/STATUS,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- STATUS11 Jan 2003 04:14:55 -  1.32
  +++ STATUS15 Jan 2003 05:22:53 -  1.33
  @@ -50,6 +50,13 @@
   Needs Patch or Further Investigation:
   -
   
  +* Currently modperl_filter_add_{connection|request} check the filter
  +  handler function attrs before accepting the filter. If the module
  +  wasn't preloaded the check fails and filter handler is skipped. We
  +  could have this issue documented (which is OK, but might raise too
  +  many questions), but we could also always preload the filter
  +  handlers. To test see TestFilter::input_msg
  +
   * we still have a problem with mod_perl starting from a
 vhost. consider the following config:
   
  
  
  



cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-14 Thread stas
stas2003/01/14 22:07:11

  Modified:src/modules/perl modperl_filter.c modperl_filter.h
modperl_types.h
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  - implementation of the input stream filtering support (1st phase)
  - code refactoring to be re-use for input and output filtering
  - proper support for mis-behaved feeding filters that send more than one
  EOS bucket
  
  Revision  ChangesPath
  1.43  +225 -66   modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- modperl_filter.c  12 Jan 2003 02:21:37 -  1.42
  +++ modperl_filter.c  15 Jan 2003 06:07:10 -  1.43
  @@ -94,15 +94,23 @@
   
   filter-mode = mode;
   filter-f = f;
  -filter-bb = bb;
   filter-pool = p;
   filter-wbucket.pool = p;
   filter-wbucket.filters = f-next;
   filter-wbucket.outcnt = 0;
   
  +if (mode == MP_INPUT_FILTER_MODE) {
  +filter-bb_in  = NULL;
  +filter-bb_out = bb;
  +}
  +else {
  +filter-bb_in  = bb;
  +filter-bb_out = NULL;
  +}
  +
   MP_TRACE_f(MP_FUNC, filter=0x%lx, mode=%s\n,
  -   (unsigned long)filter, mode == MP_OUTPUT_FILTER_MODE ?
  -   output : input);
  +   (unsigned long)filter,
  +   mode == MP_INPUT_FILTER_MODE ? input : output);
   
   return filter;
   }
  @@ -138,7 +146,10 @@
   
   modperl_handler_make_args(aTHX_ args,
 Apache::Filter, filter-f,
  -  APR::Brigade, filter-bb,
  +  APR::Brigade,
  +  (filter-mode == MP_INPUT_FILTER_MODE
  +   ? filter-bb_out
  +   : filter-bb_in),
 NULL);
   
   modperl_filter_mg_set(aTHX_ AvARRAY(args)[0], filter);
  @@ -168,26 +179,59 @@
   filter-seen_eos = 0;
   }
   
  -if (filter-mode == MP_OUTPUT_FILTER_MODE) {
  +if (filter-mode == MP_INPUT_FILTER_MODE) {
  +if (filter-bb_in) {
  +/* in the streaming mode filter-bb_in is populated on the
  + * first modperl_input_filter_read, so it must be
  + * destroyed at the end of the filter invocation
  + */
  +/* XXX: may be the filter must consume all the data? add a
  + * test to check */
  +apr_brigade_destroy(filter-bb_in);
  +filter-bb_in = NULL;
  +}
  +modperl_input_filter_flush(filter);
  +}
  +else {
   modperl_output_filter_flush(filter);
   }
  +
   
   return status;
   }
   
   /* output filters */
   
  -MP_INLINE static apr_status_t send_eos(ap_filter_t *f)
  +MP_INLINE static apr_status_t send_input_eos(modperl_filter_t *filter)
  +{
  +apr_bucket_alloc_t *ba = filter-f-c-bucket_alloc;
  +apr_bucket *b = apr_bucket_eos_create(ba);
  +APR_BRIGADE_INSERT_TAIL(filter-bb_out, b);
  +((modperl_filter_ctx_t *)filter-f-ctx)-sent_eos = 1;
  +return APR_SUCCESS;
  +
  +}
  +
  +MP_INLINE static apr_status_t send_input_flush(modperl_filter_t *filter)
  +{
  +apr_bucket_alloc_t *ba = filter-f-c-bucket_alloc;
  +apr_bucket *b = apr_bucket_flush_create(ba);
  +APR_BRIGADE_INSERT_TAIL(filter-bb_out, b);
  +return APR_SUCCESS;
  +}
  +
  +MP_INLINE static apr_status_t send_output_eos(ap_filter_t *f)
   {
   apr_bucket_alloc_t *ba = f-c-bucket_alloc;
   apr_bucket_brigade *bb = apr_brigade_create(MP_FILTER_POOL(f),
   ba);
   apr_bucket *b = apr_bucket_eos_create(ba);
   APR_BRIGADE_INSERT_TAIL(bb, b);
  +((modperl_filter_ctx_t *)f-ctx)-sent_eos = 1;
   return ap_pass_brigade(f-next, bb);
   }
   
  -MP_INLINE static apr_status_t send_flush(ap_filter_t *f)
  +MP_INLINE static apr_status_t send_output_flush(ap_filter_t *f)
   {
   apr_bucket_alloc_t *ba = f-c-bucket_alloc;
   apr_bucket_brigade *bb = apr_brigade_create(MP_FILTER_POOL(f),
  @@ -199,11 +243,14 @@
   
   /* unrolled APR_BRIGADE_FOREACH loop */
   
  +#define MP_FILTER_EMPTY(filter) \
  +APR_BRIGADE_EMPTY(filter-bb_in)
  +
   #define MP_FILTER_SENTINEL(filter) \
  -APR_BRIGADE_SENTINEL(filter-bb)
  +APR_BRIGADE_SENTINEL(filter-bb_in)
   
   #define MP_FILTER_FIRST(filter) \
  -APR_BRIGADE_FIRST(filter-bb)
  +APR_BRIGADE_FIRST(filter-bb_in)
   
   #define MP_FILTER_NEXT(filter) \
   APR_BUCKET_NEXT(filter-bucket)
  @@ -216,52 +263,83 @@
   
   MP_INLINE static int get_bucket(modperl_filter_t *filter)
   {
  -if (!filter-bb) {
  +if (!filter-bb_in || MP_FILTER_EMPTY(filter)) {
  +MP_TRACE_f(MP_FUNC, %s

cvs commit: modperl-2.0/t/filter input_body.t

2003-01-14 Thread stas
stas2003/01/14 22:08:16

  Modified:t/filter input_body.t
  Log:
  no more need for XXX
  
  Revision  ChangesPath
  1.5   +0 -1  modperl-2.0/t/filter/input_body.t
  
  Index: input_body.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/input_body.t,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- input_body.t  20 Dec 2001 03:54:41 -  1.4
  +++ input_body.t  15 Jan 2003 06:08:16 -  1.5
  @@ -4,7 +4,6 @@
   use Apache::Test;
   use Apache::TestRequest;
   
  -#XXX: skip input_body filter test until filter changes dust settles
   plan tests = 2;
   
   my $location = '/TestFilter::input_body';
  
  
  



cvs commit: modperl-2.0/xs/Apache/Filter Apache__Filter.h

2003-01-14 Thread stas
stas2003/01/14 22:11:09

  Modified:xs/Apache/Filter Apache__Filter.h
  Log:
  input filters are now supported
  
  Revision  ChangesPath
  1.22  +21 -8 modperl-2.0/xs/Apache/Filter/Apache__Filter.h
  
  Index: Apache__Filter.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Apache__Filter.h  12 Jan 2003 02:33:27 -  1.21
  +++ Apache__Filter.h  15 Jan 2003 06:11:08 -  1.22
  @@ -26,7 +26,7 @@
   mpxs_write_loop(modperl_output_filter_write, modperl_filter);
   }
   else {
  -Perl_croak(aTHX_ input filters not yet supported);
  +mpxs_write_loop(modperl_input_filter_write, modperl_filter);
   }
   
   /* XXX: ap_rflush if $| */
  @@ -38,23 +38,36 @@
SV **MARK, SV **SP)
   {
   modperl_filter_t *modperl_filter;
  +ap_input_mode_t mode = 0;
  +apr_read_type_e block = 0;
  +apr_off_t readbytes = 0;
   apr_size_t wanted, len=0;
   SV *buffer;
  -
  -mpxs_usage_va_2(modperl_filter, buffer, $filter-read(buf, [len]));
  -
  -if (items  2) {
  +
  +if (items  4) {
  +mpxs_usage_va_2(modperl_filter, buffer, $filter-read(buf, [len]));
  +}
  +else {
  +modperl_filter = mp_xs_sv2_modperl_filter(*MARK); MARK++;
  +mode   = (ap_input_mode_t)SvIV(*MARK); MARK++;
  +block  = (apr_read_type_e)SvIV(*MARK); MARK++;
  +readbytes  = (apr_off_t)SvIV(*MARK); MARK++;
  +buffer = *MARK++;
  +}
  +
  +if (items == 3 || items == 6) {
   wanted = SvIV(*MARK);
   }
   else {
   wanted = MP_IOBUFSIZE;
   }
   
  -if (modperl_filter-mode == MP_OUTPUT_FILTER_MODE) {
  -len = modperl_output_filter_read(aTHX_ modperl_filter, buffer, wanted);
  +if (modperl_filter-mode == MP_INPUT_FILTER_MODE) {
  +len = modperl_input_filter_read(aTHX_ modperl_filter, mode,
  +block, readbytes, buffer, wanted);
   }
   else {
  -Perl_croak(aTHX_ input filters not yet supported);
  +len = modperl_output_filter_read(aTHX_ modperl_filter, buffer, wanted);
   }
   
   return len;
  
  
  



cvs commit: modperl-2.0/t/filter/TestFilter in_bbs_body.pm in_bbs_msg.pm out_bbs_basic.pm out_bbs_ctx.pm out_str_api.pm out_str_ctx.pm out_str_lc.pm out_str_reverse.pm in_str_msg.pm api.pm buckets.pm context.pm context_stream.pm input_body.pm input_msg.pm lc.pm reverse.pm

2003-01-14 Thread stas
stas2003/01/14 22:47:16

  Modified:t/filter/TestFilter in_str_msg.pm
  Added:   t/filter in_bbs_body.t in_bbs_msg.t out_bbs_basic.t
out_bbs_ctx.t out_str_api.t out_str_ctx.t
out_str_lc.t out_str_reverse.t
   t/filter/TestFilter in_bbs_body.pm in_bbs_msg.pm
out_bbs_basic.pm out_bbs_ctx.pm out_str_api.pm
out_str_ctx.pm out_str_lc.pm out_str_reverse.pm
  Removed: t/filter context.t context_stream.t input_body.t input_msg.t
lc.t reverse.t
   t/filter/TestFilter api.pm buckets.pm context.pm
context_stream.pm input_body.pm input_msg.pm lc.pm
reverse.pm
  Log:
  rename filter tests so it's easy to test what kind of filter is run from
  its name (also to tell the streaming interface from BBs.)
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/filter/in_bbs_body.t
  
  Index: in_bbs_body.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  
  plan tests = 2;
  
  my $location = '/TestFilter::in_bbs_body';
  
  for my $x (1,2) {
  my $data = scalar reverse ok $x\n;
  print POST_BODY $location, content = $data;
  }
  
  
  
  1.1  modperl-2.0/t/filter/in_bbs_msg.t
  
  Index: in_bbs_msg.t
  ===
  use Apache::TestRequest;
  use Apache::Test ();
  use Apache::TestUtil;
  
  my $module = 'TestFilter::in_bbs_msg';
  
  Apache::TestRequest::scheme('http'); #force http for t/TEST -ssl
  Apache::TestRequest::module($module);
  
  my $config = Apache::Test::config();
  my $hostport = Apache::TestRequest::hostport($config);
  t_debug(connecting to $hostport);
  
  print GET_BODY(/input_filter.html);
  
  
  
  1.1  modperl-2.0/t/filter/out_bbs_basic.t
  
  Index: out_bbs_basic.t
  ===
  # WARNING: this file is generated, do not edit
  # 01: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:696
  # 02: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:713
  # 03: 
/home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfigPerl.pm:83
  # 04: 
/home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfigPerl.pm:407
  # 05: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:407
  # 06: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:422
  # 07: 
/home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:1215
  # 08: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:398
  # 09: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestRunPerl.pm:32
  # 10: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:569
  # 11: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:569
  # 12: t/TEST:19
  
  use Apache::TestRequest 'GET_BODY';
  print GET_BODY /TestFilter::out_bbs_basic;
  
  
  
  1.1  modperl-2.0/t/filter/out_bbs_ctx.t
  
  Index: out_bbs_ctx.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  use Apache::TestUtil;
  
  plan tests = 1;
  
  my $blocks  = 33;
  my $invoked = 100;
  my $sig = join \n, received $blocks complete blocks,
  filter invoked $invoked times\n;
  my $data = # x $blocks . x x $blocks;
  my $expected = join \n, $data, $sig;
  
  {
  # test the filtering of the mod_perl response handler
  my $location = '/TestFilter::out_bbs_ctx';
  my $response = GET_BODY $location;
  ok t_cmp($expected, $response, context filter);
  }
  
  
  
  1.1  modperl-2.0/t/filter/out_str_api.t
  
  Index: out_str_api.t
  ===
  # WARNING: this file is generated, do not edit
  # 01: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:696
  # 02: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:713
  # 03: 
/home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfigPerl.pm:83
  # 04: 
/home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfigPerl.pm:407
  # 05: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:407
  # 06: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:422
  # 07: 
/home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestConfig.pm:1215
  # 08: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestRun.pm:398
  # 09: /home/stas/apache.org/modperl-2.0/t/../Apache-Test/lib/Apache/TestRunPerl.pm:32
  # 10: /home/stas

cvs commit: modperl-2.0/t/response/TestError - New directory

2003-01-13 Thread stas
stas2003/01/13 22:41:49

  modperl-2.0/t/response/TestError - New directory



cvs commit: modperl-2.0/t/error - New directory

2003-01-13 Thread stas
stas2003/01/13 22:41:49

  modperl-2.0/t/error - New directory



cvs commit: modperl-2.0/t/response/TestError push_handlers.pm

2003-01-13 Thread stas
stas2003/01/13 22:42:44

  Modified:src/modules/perl modperl_callback.c
   .Changes
  Added:   t/error  push_handlers.t
   t/response/TestError push_handlers.pm
  Log:
  prevent a segfault when push_handlers are used to push a handler into
  the currently phase and switching the handler (perl-script/modperl) +
  tests
  
  Revision  ChangesPath
  1.52  +8 -4  modperl-2.0/src/modules/perl/modperl_callback.c
  
  Index: modperl_callback.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_callback.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -u -r1.51 -r1.52
  --- modperl_callback.c1 Jan 2003 03:45:54 -   1.51
  +++ modperl_callback.c14 Jan 2003 06:42:43 -  1.52
  @@ -93,7 +93,7 @@
   modperl_handler_t **handlers;
   apr_pool_t *p = NULL;
   MpAV *av, **avp;
  -int i, status = OK;
  +int i, nelts, status = OK;
   const char *desc = NULL;
   AV *av_args = Nullav;
   
  @@ -173,11 +173,15 @@
   };
   
   /* XXX: deal with {push,set}_handler of the phase we're currently in */
  -MP_TRACE_h(MP_FUNC, running %d %s handlers\n,
  -   av-nelts, desc);
  +/* for now avoid the segfault by not letting av-nelts grow if
  + * somebody push_handlers to the phase we are currently in, but
  + * different handler e.g. jumping from 'modperl' to 'perl-script',
  + * before calling push_handler */
  +nelts = av-nelts;
  +MP_TRACE_h(MP_FUNC, running %d %s handlers\n, nelts, desc);
   handlers = (modperl_handler_t **)av-elts;
   
  -for (i=0; iav-nelts; i++) {
  +for (i=0; inelts; i++) {
   if ((status = modperl_callback(aTHX_ handlers[i], p, r, s, av_args)) != OK) 
{
   status = modperl_errsv(aTHX_ status, r, s);
   }
  
  
  
  1.100 +4 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.99
  retrieving revision 1.100
  diff -u -r1.99 -r1.100
  --- Changes   12 Jan 2003 04:05:48 -  1.99
  +++ Changes   14 Jan 2003 06:42:44 -  1.100
  @@ -10,6 +10,10 @@
   
   =item 1.99_09-dev
   
  +prevent a segfault when push_handlers are used to push a handler into
  +the currently phase and switching the handler (perl-script/modperl)
  +[Stas]
  +
   Add $filter-seen_eos to the streaming filter api to know when eos has
   been seen, so special signatures can be passed and any data stored in
   the context flushed + tests. [Stas]
  
  
  
  1.1  modperl-2.0/t/error/push_handlers.t
  
  Index: push_handlers.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest;
  
  plan tests = 1;
  
  my $location = /TestError::push_handlers;
  my $expected = ok;
  my $received = GET_BODY $location;
  
  ok t_cmp($expected, $received);
  
  
  
  1.1  modperl-2.0/t/response/TestError/push_handlers.pm
  
  Index: push_handlers.pm
  ===
  package TestError::push_handlers;
  
  # This test verifies that we don't segfault when push_handlers are
  # used incorrectly. Here the handler() is running under 
  #   SetHandler modperl
  # and it modifies its handler to be 'perl-script', plus pushes another
  # handler to run. The result is that the first time handler() is run
  # under the 'modperl' handler it returns declined, therefore Apache
  # runs the registered 'perl-script' handler (which handler() has
  # pushed in plus itself. So the handler() is executed again, followed
  # by real_response(). Notice that it pushes yet another real_response
  # callback onto the list of handlers. 
  #
  # suprisingly the response eventually works, but this is a wrong way
  # to accomplish that thing. And one of the earlier stages should be
  # used to push handlers. 
  #
  # Don't modify the handler (modperl|perl-script) during the response
  # handler run-time, because if OK is not returned, the handler will be
  # executed again.
  
  
  use strict;
  use warnings;# FATAL = 'all';
  
  use Apache::RequestRec ();
  use Apache::RequestIO ();
  use Apache::RequestUtil ();
  
  use Apache::Const -compile = qw(OK DECLINED);
  
  sub handler {
  my $r = shift;
  
  #warn handler called\n;
  
  $r-handler(perl-script);
  $r-push_handlers(PerlResponseHandler = \real_response);
  
  return Apache::DECLINED;
  }
  
  sub real_response {
  my $r = shift;
  
  #warn real_response called\n;
  
  $r-content_type('text/plain');
  $r-print('ok');
  
  return Apache::OK;
  }
  
  1;
  __END__
  
  
  
  



cvs commit: modperl-2.0/src/modules/perl modperl_filter.h mod_perl.c modperl_filter.c

2003-01-11 Thread stas
stas2003/01/11 18:15:59

  Modified:xs/tables/current/ModPerl FunctionTable.pm
   src/modules/perl modperl_filter.h mod_perl.c
modperl_filter.c
  Log:
  improve the code readability by s/filter_register/filter_add/g because the
  filters are actually inserted, not just registered
  
  Revision  ChangesPath
  1.91  +4 -4  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.90
  retrieving revision 1.91
  diff -u -r1.90 -r1.91
  --- FunctionTable.pm  11 Jan 2003 00:02:16 -  1.90
  +++ FunctionTable.pm  12 Jan 2003 02:15:58 -  1.91
  @@ -2322,7 +2322,7 @@
 },
 {
   'return_type' = 'void',
  -'name' = 'modperl_input_filter_register_connection',
  +'name' = 'modperl_input_filter_add_connection',
   'args' = [
 {
   'type' = 'conn_rec *',
  @@ -2332,7 +2332,7 @@
 },
 {
   'return_type' = 'void',
  -'name' = 'modperl_input_filter_register_request',
  +'name' = 'modperl_input_filter_add_request',
   'args' = [
 {
   'type' = 'request_rec *',
  @@ -3177,7 +3177,7 @@
 },
 {
   'return_type' = 'void',
  -'name' = 'modperl_output_filter_register_connection',
  +'name' = 'modperl_output_filter_add_connection',
   'args' = [
 {
   'type' = 'conn_rec *',
  @@ -3187,7 +3187,7 @@
 },
 {
   'return_type' = 'void',
  -'name' = 'modperl_output_filter_register_request',
  +'name' = 'modperl_output_filter_add_request',
   'args' = [
 {
   'type' = 'request_rec *',
  
  
  
  1.15  +4 -4  modperl-2.0/src/modules/perl/modperl_filter.h
  
  Index: modperl_filter.h
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- modperl_filter.h  30 May 2002 02:33:48 -  1.14
  +++ modperl_filter.h  12 Jan 2003 02:15:58 -  1.15
  @@ -37,9 +37,9 @@
   apr_status_t modperl_output_filter_handler(ap_filter_t *f,
  apr_bucket_brigade *bb);
   
  -void modperl_output_filter_register_connection(conn_rec *c);
  +void modperl_output_filter_add_connection(conn_rec *c);
   
  -void modperl_output_filter_register_request(request_rec *r);
  +void modperl_output_filter_add_request(request_rec *r);
   
   MP_INLINE apr_status_t modperl_output_filter_flush(modperl_filter_t *filter);
   
  @@ -61,8 +61,8 @@
 apr_read_type_e block,
 apr_off_t readbytes);
   
  -void modperl_input_filter_register_connection(conn_rec *c);
  +void modperl_input_filter_add_connection(conn_rec *c);
   
  -void modperl_input_filter_register_request(request_rec *r);
  +void modperl_input_filter_add_request(request_rec *r);
   
   #endif /* MODPERL_FILTER_H */
  
  
  
  1.146 +4 -4  modperl-2.0/src/modules/perl/mod_perl.c
  
  Index: mod_perl.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/mod_perl.c,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- mod_perl.c12 Dec 2002 10:05:07 -  1.145
  +++ mod_perl.c12 Jan 2003 02:15:58 -  1.146
  @@ -481,8 +481,8 @@
   
   static int modperl_hook_pre_connection(conn_rec *c, void *csd)
   {
  -modperl_input_filter_register_connection(c);
  -modperl_output_filter_register_connection(c);
  +modperl_input_filter_add_connection(c);
  +modperl_output_filter_add_connection(c);
   return OK;
   }
   
  @@ -595,10 +595,10 @@
   ap_hook_handler(modperl_response_handler_cgi,
   NULL, NULL, APR_HOOK_MIDDLE);
   
  -ap_hook_insert_filter(modperl_output_filter_register_request,
  +ap_hook_insert_filter(modperl_output_filter_add_request,
 NULL, NULL, APR_HOOK_LAST);
   
  -ap_hook_insert_filter(modperl_input_filter_register_request,
  +ap_hook_insert_filter(modperl_input_filter_add_request,
 NULL, NULL, APR_HOOK_LAST);
   
   ap_register_output_filter(MP_FILTER_REQUEST_OUTPUT_NAME,
  
  
  
  1.41  +38 -38modperl-2.0/src/modules/perl/modperl_filter.c
  
  Index: modperl_filter.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_filter.c,v
  retrieving revision 1.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- modperl_filter.c  25 Nov 2002 22:47:39 -  1.40
  +++ modperl_filter.c  12 Jan 2003 02:15:58 -  1.41
  @@ -443,11

cvs commit: modperl-2.0/xs/tables/current/ModPerl FunctionTable.pm

2003-01-11 Thread stas
stas2003/01/11 18:33:28

  Modified:xs/Apache/Filter Apache__Filter.h
   xs/maps  modperl_functions.map
   xs/tables/current/ModPerl FunctionTable.pm
  Log:
  add $filter-seen_eos flag for the streaming interface
  
  Revision  ChangesPath
  1.21  +8 -0  modperl-2.0/xs/Apache/Filter/Apache__Filter.h
  
  Index: Apache__Filter.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Filter/Apache__Filter.h,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Apache__Filter.h  12 Jan 2003 02:31:54 -  1.20
  +++ Apache__Filter.h  12 Jan 2003 02:33:27 -  1.21
  @@ -125,3 +125,11 @@
   
   return ctx-data ? SvREFCNT_inc(ctx-data) : PL_sv_undef;
   }
  +
  +static MP_INLINE SV *mpxs_Apache__Filter_seen_eos(pTHX_ I32 items,
  +  SV **MARK, SV **SP)
  +{
  +modperl_filter_t *modperl_filter;
  +mpxs_usage_va_1(modperl_filter, $filter-seen_eos());
  +return modperl_filter-seen_eos ? PL_sv_yes : PL_sv_no;
  +}
  
  
  
  1.48  +1 -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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- modperl_functions.map 12 Jan 2003 02:31:54 -  1.47
  +++ modperl_functions.map 12 Jan 2003 02:33:27 -  1.48
  @@ -74,6 +74,7 @@
   
mpxs_Apache__Filter_print | | ...
mpxs_Apache__Filter_read  | | ...
  + mpxs_Apache__Filter_seen_eos | | ...
mpxs_Apache__Filter_ctx   | | filter, data=Nullsv
   
SV *:DEFINE_TIEHANDLE | | SV *:stashsv, SV *:sv=Nullsv
  
  
  
  1.93  +26 -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.92
  retrieving revision 1.93
  diff -u -r1.92 -r1.93
  --- FunctionTable.pm  12 Jan 2003 02:31:55 -  1.92
  +++ FunctionTable.pm  12 Jan 2003 02:33:28 -  1.93
  @@ -4892,6 +4892,32 @@
   ]
 },
 {
  +'return_type' = 'SV *',
  +'name' = 'mpxs_Apache__Filter_seen_eos',
  +'attr' = [
  +  'static',
  +  '__inline__'
  +],
  +'args' = [
  +  {
  +'type' = 'PerlInterpreter *',
  +'name' = 'my_perl'
  +  },
  +  {
  +'type' = 'I32',
  +'name' = 'items'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'mark'
  +  },
  +  {
  +'type' = 'SV **',
  +'name' = 'sp'
  +  }
  +]
  +  },
  +  {
   'return_type' = 'void',
   'name' = 'mpxs_Apache__Log_BOOT',
   'attr' = [
  
  
  



cvs commit: modperl-2.0/t/filter/TestFilter reverse.pm

2003-01-11 Thread stas
stas2003/01/11 18:37:11

  Modified:t/filter/TestFilter reverse.pm
  Log:
  send the signature only when eos has been seen (the filter can be invoked
  many times during the same request)
  
  Revision  ChangesPath
  1.5   +4 -1  modperl-2.0/t/filter/TestFilter/reverse.pm
  
  Index: reverse.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/reverse.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- reverse.pm25 Nov 2002 22:46:29 -  1.4
  +++ reverse.pm12 Jan 2003 02:37:11 -  1.5
  @@ -18,7 +18,10 @@
   $filter-print(\n);
   }
   }
  -$filter-print(Reversed by mod_perl 2.0\n);
  +
  +if ($filter-seen_eos) {
  +$filter-print(Reversed by mod_perl 2.0\n);
  +}
   
   return Apache::OK;
   }
  
  
  



cvs commit: modperl-2.0/t/filter/TestFilter buckets.pm

2003-01-11 Thread stas
stas2003/01/11 20:00:42

  Modified:t/filter/TestFilter buckets.pm
  Log:
  make sure that the body of the filter is executed only once
  
  Revision  ChangesPath
  1.8   +22 -17modperl-2.0/t/filter/TestFilter/buckets.pm
  
  Index: buckets.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/TestFilter/buckets.pm,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- buckets.pm11 Sep 2002 00:50:31 -  1.7
  +++ buckets.pm12 Jan 2003 04:00:42 -  1.8
  @@ -19,31 +19,36 @@
   sub handler {
   my($filter, $bb) = @_;
   
  -Apache::TestToString-start;
  +unless ($filter-ctx) {
   
  -plan tests = 4;
  +Apache::TestToString-start;
   
  -my $ba = $filter-r-connection-bucket_alloc;
  +plan tests = 4;
   
  -#should only have 1 bucket from the response() below
  -for (my $bucket = $bb-first; $bucket; $bucket = $bb-next($bucket)) {
  -ok $bucket-type-name;
  -ok $bucket-length == 2;
  -$bucket-read(my $data);
  -ok $data eq 'ok';
  -}
  +my $ba = $filter-r-connection-bucket_alloc;
  +
  +#should only have 1 bucket from the response() below
  +for (my $bucket = $bb-first; $bucket; $bucket = $bb-next($bucket)) {
  +ok $bucket-type-name;
  +ok $bucket-length == 2;
  +$bucket-read(my $data);
  +ok (defined $data and $data eq 'ok');
  +}
   
  -my $tests = Apache::TestToString-finish;
  +my $tests = Apache::TestToString-finish;
   
  -my $brigade = APR::Brigade-new($filter-r-pool, $ba);
  -my $bucket = APR::Bucket-new($tests);
  +my $brigade = APR::Brigade-new($filter-r-pool, $ba);
  +my $bucket = APR::Bucket-new($tests);
   
  -$brigade-insert_tail($bucket);
  +$brigade-insert_tail($bucket);
   
  -my $ok = $brigade-first-type-name =~ /mod_perl/ ? 4 : 0;
  -$brigade-insert_tail(APR::Bucket-new(ok $ok\n));
  +my $ok = $brigade-first-type-name =~ /mod_perl/ ? 4 : 0;
  +$brigade-insert_tail(APR::Bucket-new(ok $ok\n));
   
  -$filter-next-pass_brigade($brigade);
  +$filter-next-pass_brigade($brigade);
  +
  +$filter-ctx(1); # flag that we have run this already
  +}
   
   Apache::OK;
   }
  
  
  



cvs commit: modperl-2.0/t/apache scanhdrs2.t

2003-01-10 Thread stas
stas2003/01/10 23:41:04

  Modified:t/apache scanhdrs2.t
  Log:
  t_cmp's args are (expected, received, comment)
  not (received, expected, comment)
  (the debug info was confusing otherwise)
  
  Revision  ChangesPath
  1.2   +3 -3  modperl-2.0/t/apache/scanhdrs2.t
  
  Index: scanhdrs2.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/apache/scanhdrs2.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- scanhdrs2.t   29 Jun 2002 20:39:22 -  1.1
  +++ scanhdrs2.t   11 Jan 2003 07:41:04 -  1.2
  @@ -14,10 +14,10 @@
   
   my $res = GET $location?$redirect, redirect_ok = 0;
   
  -ok t_cmp($res-header('Location'), $redirect,
  +ok t_cmp($redirect, $res-header('Location'),
Location header);
   
  -ok t_cmp($res-code, 302,
  +ok t_cmp(302, $res-code,
status == 302);
   
   $redirect = '/index.html';
  @@ -27,7 +27,7 @@
   ok t_cmp(1, !$res-header('Location'),
no Location header);
   
  -ok t_cmp($res-code, 200,
  +ok t_cmp(200, $res-code,
status == 200);
   
   ok t_cmp(qr{welcome to}, $res-content,
  
  
  



cvs commit: modperl-2.0 STATUS

2003-01-01 Thread dougm
dougm   2003/01/01 10:43:51

  Modified:.STATUS
  Log:
  must be fixed before 1.99_08
  
  Revision  ChangesPath
  1.28  +3 -5  modperl-2.0/STATUS
  
  Index: STATUS
  ===
  RCS file: /home/cvs/modperl-2.0/STATUS,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- STATUS1 Jan 2003 03:45:54 -   1.27
  +++ STATUS1 Jan 2003 18:43:51 -   1.28
  @@ -24,11 +24,9 @@
   Release Showstoppers:
   -
   
  - * 
  -   Report: 
  -   Status: 
  -
  + * current cvs does not work with vanilla 5.6.1 or 5.8.0 (CGI.pm version issue)
   
  + * Makefile.PL process ugly unknown typemap warnings must go away
   
   Available Patches:
   --
  
  
  



cvs commit: modperl-2.0 Changes

2002-12-31 Thread stas
stas2002/12/31 19:48:20

  Modified:.Changes
  Log:
  log the recent change
  
  Revision  ChangesPath
  1.92  +2 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.91
  retrieving revision 1.92
  diff -u -r1.91 -r1.92
  --- Changes   1 Jan 2003 03:45:54 -   1.91
  +++ Changes   1 Jan 2003 03:48:20 -   1.92
  @@ -10,6 +10,8 @@
   
   =item 1.99_08-dev
   
  +Add PerlPreConnectionHandler support in Apache::Test [Stas]
  +
   Enable PerlPreConnectionHandler [Stas]
   
   Support the Host: request header in Apache::TestClient [Stas]
  
  
  



cvs commit: modperl-2.0 README

2002-12-31 Thread stas
stas2002/12/31 20:10:49

  Modified:.README
  Log:
  shape up the README file:
  - most important mention up to which Apache version the released version
  is expected to work with, to reduce a number of questions on the mod_perl
  list, when people try the latest Apache.
  - do require Perl 5.6.1, to avoid faulty bug reports
  - give credits to TicketMaster
  
  Revision  ChangesPath
  1.8   +30 -6 modperl-2.0/README
  
  Index: README
  ===
  RCS file: /home/cvs/modperl-2.0/README,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- README27 Jun 2002 06:36:03 -  1.7
  +++ README1 Jan 2003 04:10:49 -   1.8
  @@ -1,9 +1,21 @@
   This is mod_perl version 2.0-tobe
   
  -Apache version 2.0.39 or higher is required.
  +*** Prerequisites ***
   
  -Perl version 5.6.0 or higher is required. Perl-5.8.0-RC2 if you build
  -with 5.8.0 series.
  +Apache:
  +  this version of mod_perl works with Apache versions 2.0.39 -
  +  2.0.43. Older Apache versions aren't supported. Newer Apache version
  +  may not work with this version of mod_perl, but only with the cvs
  +  version which can be obtained from:
  +  http://perl.apache.org/download/source.html#2_0_Development_Source_Distribution
  +
  +Perl: 
  +  version 5.6.1 or higher is required. mod_perl builds with 5.6.0,
  +  but it's likely that you will have problems using it.
  +
  +  Perl version 5.8.0 is required for threaded MPMs.
  +
  +*** Status ***
   
   mod_perl is currently considered beta when used with the prefork MPM.
   
  @@ -12,13 +24,20 @@
   Only DSO build of mod_perl-2.0 is currently supported, static builds
   will be support in the future.
   
  -docs are available in /docs. Currently they don't get installed on
  -'make install'. Certain API documentation can be found in docs/api/.
  -the online version is at http://perl.apache.org/release/docs).
  +*** Documentation ***
  +
  +Documentation are available in /docs. Currently they don't get
  +installed on 'make install'. Certain API documentation can be found in
  +/docs/api/.  the online version is at
  +http://perl.apache.org/release/docs).
  +
  +*** Todo ***
   
   mod_perl-2.0-tobe is not 100% feature complete with the 1.xx version.
   See the todo/ directory for what remains to be done.
   
  +*** Support ***
  +
   For comments, questions, bug-reports, etc., join the mod_perl users
   list by sending mail to [EMAIL PROTECTED]
   
  @@ -28,8 +47,13 @@
   For announcements join the mod_perl announce list by sending mail to
   [EMAIL PROTECTED]
   
  +*** Developers ***
  +
   mod_perl-2.0 was designed and written by Doug MacEachern, with
   contributions from many others (see the CREDITS and Changes files).
   
   Doug's mod_perl-2.0 development time is sponsored by
   Covalent Technologies: http://www.covalent.net/
  +
  +Stas Bekman's mod_perl-2.0 development time is sponsored by
  +TicketMaster: http://www.ticketmaster.com/
  \ No newline at end of file
  
  
  



cvs commit: modperl-2.0/build xs_generate.pl

2002-12-29 Thread stas
stas2002/12/29 00:21:03

  Modified:buildxs_generate.pl
  Log:
  unshift Apache-Test/lib into @INC, so the locate Apache::Test will be
  searched for first
  
  Revision  ChangesPath
  1.2   +1 -1  modperl-2.0/build/xs_generate.pl
  
  Index: xs_generate.pl
  ===
  RCS file: /home/cvs/modperl-2.0/build/xs_generate.pl,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- xs_generate.pl5 Mar 2001 03:55:08 -   1.1
  +++ xs_generate.pl29 Dec 2002 08:21:03 -  1.2
  @@ -1,4 +1,4 @@
  -use lib qw(lib);
  +use lib qw(lib Apache-Test/lib);
   
   use ModPerl::WrapXS ();
   
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm RegistryLoader.pm

2002-12-29 Thread stas
stas2002/12/29 02:08:08

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
RegistryLoader.pm
  Log:
  support the NameWithVirtualHost setting in namespace_from_uri() as in 1.0
  (would be nice to add a test, but I'm not sure how to do that)
  
  Revision  ChangesPath
  1.26  +12 -0 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- RegistryCooker.pm 28 Dec 2002 07:13:26 -  1.25
  +++ RegistryCooker.pm 29 Dec 2002 10:08:08 -  1.26
  @@ -85,6 +85,12 @@
   
   
   #
  +
  +unless (defined $ModPerl::RegistryCooker::NameWithVirtualHost) {
  +$ModPerl::RegistryCooker::NameWithVirtualHost = 1;
  +}
  +
  +#
   # func: new
   # dflt: new
   # args: $class - class to bless into
  @@ -310,6 +316,12 @@
   my $script_name = $path_info  $self-[URI] =~ /$path_info$/ ?
substr($self-[URI], 0, length($self-[URI]) - length($path_info)) :
$self-[URI];
  +
  +if ($ModPerl::RegistryCooker::NameWithVirtualHost  
  +$self-[REQ]-server-is_virtual) {
  +my $name = $self-[REQ]-get_server_name;
  +$script_name = join , $name, $script_name if $name;
  +}
   
   $script_name =~ s:/+$:/__INDEX__:;
   
  
  
  
  1.7   +5 -1  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm
  
  Index: RegistryLoader.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- RegistryLoader.pm 29 Dec 2002 09:18:50 -  1.6
  +++ RegistryLoader.pm 29 Dec 2002 10:08:08 -  1.7
  @@ -21,7 +21,7 @@
   }
   
   sub handler {
  -my($self, $uri, $filename) = @_;
  +my($self, $uri, $filename, $virthost) = @_;
   
   # set the inheritance rules at run time
   @ISA = $self-{package};
  @@ -73,6 +73,8 @@
   package  = $self-{package},
   } = ref($self) || $self;
   
  +$rl-{virthost} = $virthost if defined $virthost;
  +
   # can't call SUPER::handler here, because it usually calls new()
   # and then the ModPerlRegistryLoader::new() will get called,
   # instead of the super class' new, so we implement the super
  @@ -86,6 +88,7 @@
   # when when finfo() and slurp_filename() are ported to 2.0 and
   # RegistryCooker is starting to use them
   
  +sub get_server_name { return $_[0]-{virthost} if exists $_[0]-{virthost} }
   sub filename { shift-{filename} }
   sub status { Apache::HTTP_OK }
   sub my_finfo{ shift-{filename} }
  @@ -95,6 +98,7 @@
   sub log_error { shift; die @_ if $@; warn @_; }
   sub run { return Apache::OK } # don't run the script
   sub server { shift }
  +sub is_virtual { exists shift-{virthost} }
   
   # the preloaded file needs to be precompiled into the package
   # specified by the 'package' attribute, not RegistryLoader
  
  
  



cvs commit: modperl-2.0 Changes

2002-12-29 Thread stas
stas2002/12/29 02:11:49

  Modified:ModPerl-Registry TODO
   .Changes
  Log:
  document recent changes
  
  Revision  ChangesPath
  1.11  +0 -2  modperl-2.0/ModPerl-Registry/TODO
  
  Index: TODO
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/TODO,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TODO  26 Nov 2002 07:47:26 -  1.10
  +++ TODO  29 Dec 2002 10:11:49 -  1.11
  @@ -25,8 +25,6 @@
   
   - $Apache::Server::CWD doesn't exist
   
  -- NameWithVirtualHost is not handled
  -
   - need to figure out what's happening with
 ModPerl::Registry::MarkLine, why it's not on by default?
   
  
  
  
  1.89  +9 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.88
  retrieving revision 1.89
  diff -u -r1.88 -r1.89
  --- Changes   21 Dec 2002 03:46:07 -  1.88
  +++ Changes   29 Dec 2002 10:11:49 -  1.89
  @@ -10,6 +10,15 @@
   
   =item 1.99_08-dev
   
  +restore the ModPerl::RegistryLoader::new() method for backwards
  +compatibility  [Stas]
  +
  +port the support for NameWithVirtualHost in ModPerl::RegistryCooker
  +and ModPerl::RegistryLoader [Stas]
  +
  +fix the handling of the return status in ModPerl::RegistryCooker, add
  +a test to verify that [Stas]
  +
   under non-threaded perl need to check whether mod_perl is running,
   when modperl_vhost_is_running check is done. [Stas]
   
  
  
  



cvs commit: modperl-2.0/lib/ModPerl TypeMap.pm

2002-12-29 Thread stas
stas2002/12/29 16:27:13

  Modified:lib/ModPerl TypeMap.pm
  Log:
  print a warning when a function is not going to be glued, because one of its
  args or return types can't be resolved
  
  Revision  ChangesPath
  1.18  +9 -3  modperl-2.0/lib/ModPerl/TypeMap.pm
  
  Index: TypeMap.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/ModPerl/TypeMap.pm,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- TypeMap.pm23 May 2002 19:49:07 -  1.17
  +++ TypeMap.pm30 Dec 2002 00:27:13 -  1.18
  @@ -144,7 +144,7 @@
   return 1 if $map-{argspec};
   
   for (@_) {
  -return unless $self-map_type($_);
  +return (0, $_) unless $self-map_type($_);
   }
   
   return 1;
  @@ -230,8 +230,14 @@
   
   $self-thx_fixup($func);
   
  -return unless $self-can_map($map, $func-{return_type},
  - map $_-{type}, @{ $func-{args} });
  +my($status, $failed_type) = 
  +$self-can_map($map, $func-{return_type},
  +map $_-{type}, @{ $func-{args} });
  +
  +unless ($status) {
  +warn unknown typemap: '$failed_type' (skipping $func-{name})\n;
  +return;
  +}
   
   my $type = $map-{return_type} || $func-{return_type} || 'void';
   my $map_type = $self-map_type($type);
  
  
  



cvs commit: modperl-2.0/t/directive perlloadmodule3.t

2002-12-29 Thread stas
stas2002/12/29 16:59:23

  Modified:t/directive perlloadmodule3.t
  Log:
  make this test work with Apache::TestClient, Apache::TestRequest::module()
  affects global testing env, so should run it only when it's needed.
  
  Revision  ChangesPath
  1.3   +7 -8  modperl-2.0/t/directive/perlloadmodule3.t
  
  Index: perlloadmodule3.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/directive/perlloadmodule3.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- perlloadmodule3.t 21 Dec 2002 03:47:18 -  1.2
  +++ perlloadmodule3.t 30 Dec 2002 00:59:23 -  1.3
  @@ -9,15 +9,11 @@
   my $config   = Apache::Test::config();
   my $base_hostport = Apache::TestRequest::hostport($config);
   
  -Apache::TestRequest::module($module);
  -my $hostport = Apache::TestRequest::hostport($config);
  -
  -# XXX: probably a good idea to split into more tests, that test
  -# smaller portions of information, but requires a more elaborated
  -# logic.
  +# XXX: probably a good idea to split into more sub-tests, that test
  +# smaller portions of information, but requires a more elaborate
  +# logic. Alternatively could use diff($expected, $received).
   
  -# XXX: this subtest fails when lwp is not installed, need to investigate
  -plan tests = 3, todo = [1];
  +plan tests = 3;
   
   t_debug(connecting to $base_hostport);
   {
  @@ -40,6 +36,9 @@
   my $received = GET_BODY $location;
   ok t_cmp($expected, $received, server merge);
   }
  +
  +Apache::TestRequest::module($module);
  +my $hostport = Apache::TestRequest::hostport($config);
   
   t_debug(connecting to $hostport);
   {
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryCooker.pm

2002-12-27 Thread stas
stas2002/12/27 23:13:26

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
  Log:
  constant.pm already wrappes the values into a sub call, so no need to do
  it twice
  
  Revision  ChangesPath
  1.25  +3 -3  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- RegistryCooker.pm 24 Dec 2002 01:51:40 -  1.24
  +++ RegistryCooker.pm 28 Dec 2002 07:13:26 -  1.25
  @@ -76,9 +76,9 @@
   # constant subs
   #
   #
  -use constant NOP   = sub {   };
  -use constant TRUE  = sub { 1 };
  -use constant FALSE = sub { 0 };
  +use constant NOP   = '';
  +use constant TRUE  = 1;
  +use constant FALSE = 0;
   
   
   use constant NAMESPACE_ROOT = 'ModPerl::ROOT';
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/lib/ModPerl RegistryLoader.pm

2002-12-27 Thread stas
stas2002/12/27 23:39:21

  Modified:ModPerl-Registry/lib/ModPerl RegistryLoader.pm
  Log:
  use the ModPerl::Registry package as the default, so it'll be backcompat
  with 1.0
  
  Revision  ChangesPath
  1.5   +1 -0  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm
  
  Index: RegistryLoader.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryLoader.pm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- RegistryLoader.pm 16 Aug 2002 09:01:17 -  1.4
  +++ RegistryLoader.pm 28 Dec 2002 07:39:20 -  1.5
  @@ -16,6 +16,7 @@
   sub create {
   my $class = shift;
   my $self = bless {@_} = ref($class)||$class;
  +$self-{package} ||= 'ModPerl::Registry';
   $self-{pool} = APR::Pool-new();
   $self-load_package($self-{package});
   return $self;
  
  
  



cvs commit: modperl-2.0/ModPerl-Registry/t/conf extra.conf.in

2002-12-23 Thread stas
stas2002/12/23 17:51:40

  Modified:ModPerl-Registry/lib/ModPerl RegistryCooker.pm
   ModPerl-Registry/t/conf extra.conf.in
  Added:   ModPerl-Registry/t 404.t
   ModPerl-Registry/t/cgi-bin 404.pl
  Log:
  fix the handling of the return status in ModPerl::RegistryCooker,
  add a test to verify that
  
  Revision  ChangesPath
  1.1  modperl-2.0/ModPerl-Registry/t/404.t
  
  Index: 404.t
  ===
  use strict;
  use warnings FATAL = 'all';
  
  use Apache::Test;
  use Apache::TestUtil;
  use Apache::TestRequest qw(GET_BODY HEAD);
  
  plan tests = 1;
  
  my $url = /error_document/cannot_be_found;
  
  {
  my $response = Oops, can't find the requested doc;
  ok t_cmp(
  $response,
  GET_BODY($url),
  test ErrorDocument,
 );
  }
  
  
  
  1.1  modperl-2.0/ModPerl-Registry/t/cgi-bin/404.pl
  
  Index: 404.pl
  ===
  use strict;
  use warnings;
  
  my $r = shift;
  $r-content_type('text/plain');
  print Oops, can't find the requested doc;
  
  
  
  1.24  +2 -2  modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
  
  Index: RegistryCooker.pm
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- RegistryCooker.pm 16 Aug 2002 09:01:17 -  1.23
  +++ RegistryCooker.pm 24 Dec 2002 01:51:40 -  1.24
  @@ -157,9 +157,9 @@
   # handlers shouldn't set $r-status but return it
   my $old_status = $self-[REQ]-status;
   my $rc = $self-run;
  -my $new_status = $self-[REQ]-status($old_status);
  +$self-[REQ]-status($old_status);
   
  -return ($rc != Apache::OK) ? $rc : $new_status;
  +return ($rc != Apache::OK) ? $rc : $self-[STATUS];
   }
   
   #
  
  
  
  1.8   +9 -0  modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in
  
  Index: extra.conf.in
  ===
  RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/t/conf/extra.conf.in,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- extra.conf.in 15 Aug 2002 16:17:52 -  1.7
  +++ extra.conf.in 24 Dec 2002 01:51:40 -  1.8
  @@ -117,3 +117,12 @@
   PerlOptions +ParseHeaders
   /Location
   
  +### the 404 test ###
  +
  +Alias /error_document/ @ServerRoot@/cgi-bin/
  +Location /error_document
  +ErrorDocument 404 /error_document/404.pl
  +SetHandler perl-script
  +Options +ExecCGI
  +PerlResponseHandler ModPerl::Registry
  +/Location
  
  
  



cvs commit: modperl-2.0 Changes

2002-12-20 Thread stas
stas2002/12/20 18:26:02

  Modified:src/modules/perl modperl_cmd.c
   .Changes
  Log:
  revert the last change, the file/linenumber of the error are already
  reported by httpd
  
  Revision  ChangesPath
  1.36  +2 -5  modperl-2.0/src/modules/perl/modperl_cmd.c
  
  Index: modperl_cmd.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
  retrieving revision 1.35
  retrieving revision 1.36
  diff -u -r1.35 -r1.36
  --- modperl_cmd.c 20 Dec 2002 07:23:00 -  1.35
  +++ modperl_cmd.c 21 Dec 2002 02:26:02 -  1.36
  @@ -8,11 +8,8 @@
   
   static char *modperl_cmd_too_late(cmd_parms *parms)
   {
  -return apr_psprintf(parms-pool,
  -mod_perl is already running, too late for %s (%s:%d),
  -parms-cmd-name,
  -parms-directive-filename,
  -parms-directive-line_num);
  +return apr_pstrcat(parms-pool, mod_perl is already running, 
  +   too late for , parms-cmd-name, NULL);
   }
   
   char *modperl_cmd_push_handlers(MpAV **handlers, const char *name,
  
  
  
  1.87  +0 -3  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.86
  retrieving revision 1.87
  diff -u -r1.86 -r1.87
  --- Changes   20 Dec 2002 07:23:00 -  1.86
  +++ Changes   21 Dec 2002 02:26:02 -  1.87
  @@ -10,9 +10,6 @@
   
   =item 1.99_08-dev
   
  -when reporting too late for something, print the config file and the
  -line number [Stas]
  -
   fix $r-read to read all the requested amount of data if possible,
   adjust the test TestApache::read to verify that [Stas]
   
  
  
  



cvs commit: modperl-2.0 Changes

2002-12-20 Thread stas
stas2002/12/20 19:46:07

  Modified:src/modules/perl modperl_cmd.c
   .Changes
  Log:
  under non-threaded perl need to check whether mod_perl is running,
  when modperl_vhost_is_running check is done.
  
  Revision  ChangesPath
  1.37  +1 -1  modperl-2.0/src/modules/perl/modperl_cmd.c
  
  Index: modperl_cmd.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
  retrieving revision 1.36
  retrieving revision 1.37
  diff -u -r1.36 -r1.37
  --- modperl_cmd.c 21 Dec 2002 02:26:02 -  1.36
  +++ modperl_cmd.c 21 Dec 2002 03:46:07 -  1.37
  @@ -61,7 +61,7 @@
   return FALSE;
   }
   #else
  -return TRUE;
  +return modperl_is_running();
   #endif
   }
   
  
  
  
  1.88  +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- Changes   21 Dec 2002 02:26:02 -  1.87
  +++ Changes   21 Dec 2002 03:46:07 -  1.88
  @@ -10,6 +10,9 @@
   
   =item 1.99_08-dev
   
  +under non-threaded perl need to check whether mod_perl is running,
  +when modperl_vhost_is_running check is done. [Stas]
  +
   fix $r-read to read all the requested amount of data if possible,
   adjust the test TestApache::read to verify that [Stas]
   
  
  
  



cvs commit: modperl-2.0/t/directive perlloadmodule3.t

2002-12-20 Thread stas
stas2002/12/20 19:47:18

  Modified:t/directive perlloadmodule3.t
  Log:
  1st subtest fails when lwp is not installed, need to investigate, make it
  TODO for now
  
  Revision  ChangesPath
  1.2   +2 -1  modperl-2.0/t/directive/perlloadmodule3.t
  
  Index: perlloadmodule3.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/directive/perlloadmodule3.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- perlloadmodule3.t 12 Dec 2002 10:13:56 -  1.1
  +++ perlloadmodule3.t 21 Dec 2002 03:47:18 -  1.2
  @@ -16,7 +16,8 @@
   # smaller portions of information, but requires a more elaborated
   # logic.
   
  -plan tests = 3;
  +# XXX: this subtest fails when lwp is not installed, need to investigate
  +plan tests = 3, todo = [1];
   
   t_debug(connecting to $base_hostport);
   {
  
  
  



cvs commit: modperl-2.0 Changes

2002-12-19 Thread stas
stas2002/12/19 23:23:00

  Modified:src/modules/perl modperl_cmd.c
   .Changes
  Log:
  when reporting too late for something, print the config file and the
  line number
  
  Revision  ChangesPath
  1.35  +5 -2  modperl-2.0/src/modules/perl/modperl_cmd.c
  
  Index: modperl_cmd.c
  ===
  RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_cmd.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- modperl_cmd.c 12 Dec 2002 11:45:26 -  1.34
  +++ modperl_cmd.c 20 Dec 2002 07:23:00 -  1.35
  @@ -8,8 +8,11 @@
   
   static char *modperl_cmd_too_late(cmd_parms *parms)
   {
  -return apr_pstrcat(parms-pool, mod_perl is already running, 
  -   too late for , parms-cmd-name, NULL);
  +return apr_psprintf(parms-pool,
  +mod_perl is already running, too late for %s (%s:%d),
  +parms-cmd-name,
  +parms-directive-filename,
  +parms-directive-line_num);
   }
   
   char *modperl_cmd_push_handlers(MpAV **handlers, const char *name,
  
  
  
  1.86  +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.85
  retrieving revision 1.86
  diff -u -r1.85 -r1.86
  --- Changes   17 Dec 2002 07:15:46 -  1.85
  +++ Changes   20 Dec 2002 07:23:00 -  1.86
  @@ -10,6 +10,9 @@
   
   =item 1.99_08-dev
   
  +when reporting too late for something, print the config file and the
  +line number [Stas]
  +
   fix $r-read to read all the requested amount of data if possible,
   adjust the test TestApache::read to verify that [Stas]
   
  
  
  



modperl 2.0 problems with Apache::Cookie and related modules.

2002-12-19 Thread b. ash
Hi,

I am trying to configure a working apache2/modperl2 setup, unfortunately 
I can not seemt to get a critical module Apache::Cookie to install,  I 
keep getting this error.

Can't locate Apache/MyConfig.pm in @INC (@INC contains: 
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi 
/usr/local/lib/perl5/5.8.0 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) 
at Makefile.PL line 27.
BEGIN failed--compilation aborted at Makefile.PL line 27.

any ideas what might be going on here.

Thanks

--bash



Re: modperl 2.0 problems with Apache::Cookie and related modules.

2002-12-19 Thread Randy Kobes
On Thu, 19 Dec 2002, b. ash wrote:

 Hi,
 
 I am trying to configure a working apache2/modperl2 setup, unfortunately 
 I can not seemt to get a critical module Apache::Cookie to install,  I 
 keep getting this error.
 
 Can't locate Apache/MyConfig.pm in @INC (@INC contains: 
 /usr/local/lib/perl5/5.8.0/i686-linux-thread-multi 
 /usr/local/lib/perl5/5.8.0 
 /usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
 /usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) 
 at Makefile.PL line 27.
 BEGIN failed--compilation aborted at Makefile.PL line 27.
 
 any ideas what might be going on here.

Apache::Cookie (and Apache::Request) haven't been ported to
mod_perl-2 yet. Until that happens, you can use the mod_perl-2
compatibility mode to do form data, and for cookies, you can use
a CPAN module (eg, CGI.pm).

-- 
best regards,
randy kobes




RE: modperl 2.0 problems with Apache::Cookie and related modules.

2002-12-19 Thread Beau E. Cox
Hi -

You may want to check out my experiences w/ap2-mp2 shown in:

http://beaucox.com/mason/mason-with-apmp2-mini-HOWTO.htm

It shows how I intalled these packages.

Aloha = Beau.

-Original Message-
From: b. ash [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 19, 2002 10:40 AM
To: [EMAIL PROTECTED]
Subject: modperl 2.0 problems with Apache::Cookie and related modules.


Hi,

I am trying to configure a working apache2/modperl2 setup, unfortunately 
I can not seemt to get a critical module Apache::Cookie to install,  I 
keep getting this error.

Can't locate Apache/MyConfig.pm in @INC (@INC contains: 
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi 
/usr/local/lib/perl5/5.8.0 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) 
at Makefile.PL line 27.
BEGIN failed--compilation aborted at Makefile.PL line 27.

any ideas what might be going on here.

Thanks

--bash






Re: modperl 2.0 problems with Apache::Cookie and related modules.

2002-12-19 Thread Stas Bekman
b. ash wrote:

Hi,

I am trying to configure a working apache2/modperl2 setup, unfortunately 
I can not seemt to get a critical module Apache::Cookie to install,  I 
keep getting this error.

Can't locate Apache/MyConfig.pm in @INC (@INC contains: 
/usr/local/lib/perl5/5.8.0/i686-linux-thread-multi 
/usr/local/lib/perl5/5.8.0 
/usr/local/lib/perl5/site_perl/5.8.0/i686-linux-thread-multi 
/usr/local/lib/perl5/site_perl/5.8.0 /usr/local/lib/perl5/site_perl .) 
at Makefile.PL line 27.
BEGIN failed--compilation aborted at Makefile.PL line 27.

any ideas what might be going on here.

A backcompat version of Apache::MyConfig is now available via 
Apache::compat in the mod_perl cvs. Though it won't solve the 
Apache::Cookie lib as reported by others.


__
Stas BekmanJAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide --- http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com



cvs commit: modperl-2.0/t/response/TestCompat request_body.pm

2002-12-15 Thread stas
stas2002/12/15 00:30:40

  Modified:.Changes
   lib/Apache compat.pm
   t/conf   modperl_extra.pl
   t/compat request_body.t
   t/response/TestCompat request_body.pm
  Log:
  fix the method content() in Apache::compat to read a whole request
  body. same for ModPerl::Test::read_post. add tests.
  
  Revision  ChangesPath
  1.84  +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.83
  retrieving revision 1.84
  diff -u -r1.83 -r1.84
  --- Changes   15 Dec 2002 07:43:40 -  1.83
  +++ Changes   15 Dec 2002 08:30:39 -  1.84
  @@ -10,6 +10,9 @@
   
   =item 1.99_08-dev
   
  +fix the method content() in Apache::compat to read a whole request
  +body. same for ModPerl::Test::read_post. add tests.  [Stas]
  +
   Adjust the reverse filter test to work on win32 (remove trailing \r)
   [Randy Kobes [EMAIL PROTECTED]]
   
  
  
  
  1.75  +11 -7 modperl-2.0/lib/Apache/compat.pm
  
  Index: compat.pm
  ===
  RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v
  retrieving revision 1.74
  retrieving revision 1.75
  diff -u -r1.74 -r1.75
  --- compat.pm 6 Dec 2002 13:09:15 -   1.74
  +++ compat.pm 15 Dec 2002 08:30:40 -  1.75
  @@ -241,6 +241,8 @@
   return $r-parse_args($args);
   }
   
  +use constant IOBUFSIZE = 8192;
  +
   sub content {
   my $r = shift;
   
  @@ -248,13 +250,17 @@
   
   return undef unless $r-should_client_block;
   
  -my $len = $r-headers_in-get('content-length');
  -
  +my $data = '';
   my $buf;
  -$r-get_client_block($buf, $len);
  +while (my $read_len = $r-get_client_block($buf, IOBUFSIZE)) {
  +if ($read_len == -1) {
  +die some error while reading with get_client_block;
  +}
  +$data .= $buf;
  +}
   
  -return $buf unless wantarray;
  -return $r-parse_args($buf)
  +return $data unless wantarray;
  +return $r-parse_args($data);
   }
   
   sub clear_rgy_endav {
  @@ -316,8 +322,6 @@
   $r-read($line, $r-headers_in-get('Content-length'));
   $line ? $line : undef;
   }
  -
  -use constant IOBUFSIZE = 8192;
   
   #XXX: howto convert PerlIO to apr_file_t
   #so we can use the real ap_send_fd function
  
  
  
  1.21  +10 -4 modperl-2.0/t/conf/modperl_extra.pl
  
  Index: modperl_extra.pl
  ===
  RCS file: /home/cvs/modperl-2.0/t/conf/modperl_extra.pl,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- modperl_extra.pl  7 Oct 2002 02:35:18 -   1.20
  +++ modperl_extra.pl  15 Dec 2002 08:30:40 -  1.21
  @@ -47,6 +47,8 @@
   $server-log-info(base server + $vhosts vhosts ready to run tests);
   }
   
  +use constant IOBUFSIZE = 8192;
  +
   sub ModPerl::Test::read_post {
   my $r = shift;
   
  @@ -54,12 +56,16 @@
   
   return undef unless $r-should_client_block;
   
  -my $len = $r-headers_in-get('content-length');
  -
  +my $data = '';
   my $buf;
  -$r-get_client_block($buf, $len);
  +while (my $read_len = $r-get_client_block($buf, IOBUFSIZE)) {
  +if ($read_len == -1) {
  +die some error while reading with get_client_block;
  +}
  +$data .= $buf;
  +}
   
  -return $buf;
  +return $data;
   }
   
   sub ModPerl::Test::add_config {
  
  
  
  1.2   +30 -16modperl-2.0/t/compat/request_body.t
  
  Index: request_body.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/compat/request_body.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- request_body.t15 Aug 2002 09:35:11 -  1.1
  +++ request_body.t15 Dec 2002 08:30:40 -  1.2
  @@ -6,7 +6,7 @@
   use Apache::TestUtil;
   use Apache::TestRequest;
   
  -plan tests = 3;
  +plan tests = 5;
   
   my $location = /TestCompat::request_body;
   
  @@ -41,6 +41,35 @@
   );
   }
   
  +# encoding/decoding
  +{
  +my %data = (
  +test = 'decoding',
  +body = '%DC%DC+%EC%2E+%D6%D6+%D6%2F',
  +);
  +ok t_cmp(
  +$data{body},
  +GET_BODY(query(%data)),
  +q{decoding}
  +   );
  +}
  +
  +
  +# big POST
  +{
  +my %data = (
  +test = 'big_input',
  +body = ('x' x 819_235),
  +   );
  +my $content = join '=', %data;
  +ok t_cmp(
  +length($data{body}),
  +POST_BODY($location, content = $content),
  +q{big POST}
  +   );
  +}
  +
  +
   
   ### helper subs ###
   sub query {
  @@ -48,18 +77,3 @@
   $location? . join '', map { $_=$args{$_} } keys %args;
   }
   
  -# accepts multiline var where, the lines

cvs commit: modperl-2.0/xs/APR/APR Makefile.PL

2002-12-15 Thread stas
stas2002/12/15 00:49:24

  Modified:xs/APR/APR Makefile.PL
  Log:
  s/qx/qq/; need to build the string not to run it
  
  Revision  ChangesPath
  1.7   +2 -1  modperl-2.0/xs/APR/APR/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/xs/APR/APR/Makefile.PL,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Makefile.PL   28 Nov 2002 08:43:33 -  1.6
  +++ Makefile.PL   15 Dec 2002 08:49:24 -  1.7
  @@ -6,8 +6,9 @@
   
   # XXX: this works only with libapr 0.9.2+ (not on win32)
   my @libs = grep $_, map { -x $_  qx{$_ --link-ld} }
  -map { qx{$prefix/bin/$_-config} } qw(apr apu);
  +map { qq{$prefix/bin/$_-config} } qw(apr apu);
   chomp @libs;
  +
   my $define = @libs ? '-DMP_HAVE_APR_LIBS' : '';
   
   ModPerl::MM::WriteMakefile(
  
  
  



cvs commit: modperl-2.0 Makefile.PL Changes

2002-12-14 Thread stas
stas2002/12/14 20:03:43

  Modified:.Makefile.PL Changes
  Log:
  Strongly suggest win32 users to upgrade to 5.8.0, if they run 5.6.x
  Submitted by: Randy Kobes [EMAIL PROTECTED]
  Reviewed by:  stas
  
  Revision  ChangesPath
  1.88  +7 -2  modperl-2.0/Makefile.PL
  
  Index: Makefile.PL
  ===
  RCS file: /home/cvs/modperl-2.0/Makefile.PL,v
  retrieving revision 1.87
  retrieving revision 1.88
  diff -u -r1.87 -r1.88
  --- Makefile.PL   29 Jun 2002 19:44:04 -  1.87
  +++ Makefile.PL   15 Dec 2002 04:03:43 -  1.88
  @@ -298,13 +298,18 @@
   sub perl_version_check {
   if ($]  5.006_001) {
   error You are running Perl version 5.6.0\n .
  -  We strongly suggest you upgrade to at least 5.6.1;
  +We strongly suggest you upgrade to at least 5.6.1;
   }
   
   if ($] = 5.007 and $]  5.008) {
   error 5.7.x development versions of Perl are no longer supported\n .
  -  Upgrade to 5.8.0 or higher;
  +Upgrade to 5.8.0 or higher;
   exit 1;
  +}
  +
  +if (WIN32 and $]  5.008) {
  +error You are running a Perl version 5.6.x\n .
  +We strongly suggest you upgrade to 5.8\n;
   }
   }
   
  
  
  
  1.82  +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.81
  retrieving revision 1.82
  diff -u -r1.81 -r1.82
  --- Changes   14 Dec 2002 17:29:34 -  1.81
  +++ Changes   15 Dec 2002 04:03:43 -  1.82
  @@ -10,6 +10,9 @@
   
   =item 1.99_08-dev
   
  +Strongly suggest win32 users to upgrade to 5.8.0, if they run 5.6.x
  +[Randy Kobes [EMAIL PROTECTED]]
  +
   When installing the mod_perl shared object, first need to check
   whether the directory 'modules' already exists, and create it if not.
   [Randy Kobes [EMAIL PROTECTED]]
  
  
  



cvs commit: modperl-2.0 Changes

2002-12-14 Thread stas
stas2002/12/14 23:43:40

  Modified:t/filter reverse.t
   .Changes
  Log:
  Adjust the reverse filter test to work on win32 (remove trailing \r)
  Submitted by: Randy Kobes [EMAIL PROTECTED]
  Reviewed by:  stas
  
  Revision  ChangesPath
  1.4   +1 -0  modperl-2.0/t/filter/reverse.t
  
  Index: reverse.t
  ===
  RCS file: /home/cvs/modperl-2.0/t/filter/reverse.t,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- reverse.t 25 Nov 2002 22:46:28 -  1.3
  +++ reverse.t 15 Dec 2002 07:43:40 -  1.4
  @@ -25,5 +25,6 @@
   # test the filtering of the non-mod_perl response handler (file)
   my $location = '/filter/reverse.txt';
   my $response = GET_BODY $location;
  +$response =~ s/\r//g;
   ok t_cmp($expected, $response, reverse filter);
   }
  
  
  
  1.83  +3 -0  modperl-2.0/Changes
  
  Index: Changes
  ===
  RCS file: /home/cvs/modperl-2.0/Changes,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- Changes   15 Dec 2002 04:03:43 -  1.82
  +++ Changes   15 Dec 2002 07:43:40 -  1.83
  @@ -10,6 +10,9 @@
   
   =item 1.99_08-dev
   
  +Adjust the reverse filter test to work on win32 (remove trailing \r)
  +[Randy Kobes [EMAIL PROTECTED]]
  +
   Strongly suggest win32 users to upgrade to 5.8.0, if they run 5.6.x
   [Randy Kobes [EMAIL PROTECTED]]
   
  
  
  



cvs commit: modperl-2.0/xs/Apache/Module Apache__Module.h

2002-12-12 Thread stas
stas2002/12/12 00:43:38

  Modified:xs/Apache/Module Apache__Module.h
  Log:
  prevent segfaults, when scfg is NULL
  
  Revision  ChangesPath
  1.8   +2 -1  modperl-2.0/xs/Apache/Module/Apache__Module.h
  
  Index: Apache__Module.h
  ===
  RCS file: /home/cvs/modperl-2.0/xs/Apache/Module/Apache__Module.h,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Apache__Module.h  2 Dec 2002 14:20:23 -   1.7
  +++ Apache__Module.h  12 Dec 2002 08:43:38 -  1.8
  @@ -63,7 +63,8 @@
   name = SvPV(pmodule, n_a);
   }
   
  -if (!(modp = apr_hash_get(scfg-modules, name, APR_HASH_KEY_STRING))) {
  +if (!(scfg-modules 
  +  (modp = apr_hash_get(scfg-modules, name, APR_HASH_KEY_STRING {
   return PL_sv_undef;
   }
   
  
  
  



  1   2   3   4   5   6   7   8   9   10   >