Re: mod_perl, ENV{'TZ'}, and localtime

2007-12-30 Thread Kirk Noda

At 09:12 PM 12/28/2007, you wrote:
[...]

The reason this does not work under modperl version 2.0 is because under
handler perl-script, %ENV is untied from the C environment.  The

[...]

Thanks very much, that works.



help with rewriting CGI

2007-12-30 Thread Raful Mr Mitchell H
I have a site that is written with traditional CGI (no cgi.pm ).  I use 
mod_perl2 but rather than run the scripts as CGI I want to convert them to 
mod_perl.  I have read Beckman's latest on mod_perl 2 and have Practical 
Mod_Perl. 
 
Here's the question.  From what I have read, it looks like I should re-write my 
perl scripts as perl modules and make the appropriate changes, such as using $r 
inside handlers, etc.  Once complete, I can preload the modules at Apache 
startup.  Is that correct?  Also, I may want to use ajax, therefore, what 
modules will I need to run Apache2::Ajax?
 
Thanks,
 
Mitch

Mitchell Raful MCSE CCNP 
MCB Quantico 
Personal and Family Readiness (MRI) 
3044 Catlin Avenue 
Quantico, VA 22134 
Com: 703-784-5991 
DSN: 278-5991 
Cell: 804-363-0731 

 


Re: help with rewriting CGI

2007-12-30 Thread Boysenberry Payne
Once complete, I can preload the modules at Apache startup.  Is  
that correct?



If you want to benefit from pre compiling your code using something  
like a startup.pl file to load the modules

you use would speed things up considerably from running them as CGI cgi.

I use 2 files one for 3rd party modules and one for my own with it's  
own include path.


Also, I may want to use ajax, therefore, what modules will I need  
to run Apache2::Ajax?


Ajax is a client side technology.  You would use whatever you're  
using now, only
running your cgi as mod_perl scripts instead, e.g. if you use CGI.pm  
to process
ajax requests currently, you might want to look into the APR modules  
as replacements for

acquiring your request data.
http://httpd.apache.org/apreq/docs/libapreq2/modules.html

Also keep in mind using mod_perl over standard cgi scripts gives you  
a larger apache life cycle,
i.e. some scripts might be better off applied as filters rather than  
during the response phase.


http://perl.apache.org/docs/2.0/user/handlers/ 
http.html#PerlResponseHandler
http://perl.apache.org/docs/2.0/user/handlers/ 
filters.html#HTTP_Request_Versus_Connection_Filters


Hope that helps.

-bop

On Dec 30, 2007, at 9:10 AM, Raful Mr Mitchell H wrote:

I have a site that is written with traditional CGI (no cgi.pm ).  I  
use mod_perl2 but rather than run the scripts as CGI I want to  
convert them to mod_perl.  I have read Beckman's latest on mod_perl  
2 and have Practical Mod_Perl.


Here's the question.  From what I have read, it looks like I should  
re-write my perl scripts as perl modules and make the appropriate  
changes, such as using $r inside handlers, etc.  Once complete, I  
can preload the modules at Apache startup.  Is that correct?  Also,  
I may want to use ajax, therefore, what modules will I need to run  
Apache2::Ajax?


Thanks,

Mitch
Mitchell Raful MCSE CCNP
MCB Quantico
Personal and Family Readiness (MRI)
3044 Catlin Avenue
Quantico, VA 22134
Com: 703-784-5991
DSN: 278-5991
Cell: 804-363-0731






Re: [bugreport] Internal Server Error output - but no error

2007-12-30 Thread Kate Yoak
I have solved the problem. I was returning 200 instead of using  
Apache2::Const::OK. My response was indeed interpreted as 'OK by  
apache - but not by some place somewhere else. There was no error  
message anywhere. I'll modify the bugreport below to have it  
addressed or not at the maintainers' discretion.

On Dec 29, 2007, at 11:14 AM, Kate Yoak wrote:


I am using mp2bug format for the message.  Hope, that's ok!


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


returning 200 as a scalar from a content handler causes Apache to  
spit up Internal Server Error html despite a '200 OK'  status.  
There is no error or warning in the log, nor any other indication of  
a problem



sub handler{
return 200;
}

Generates the proper headers:
HTTP/1.1 200 OK
Date: Sun, 30 Dec 2007 03:12:03 GMT
Server: Apache/2.2.6 (Unix) mod_perl/2.0.3 Perl/v5.8.8
Content-Length: 497
Content-Type: text/html; charset=iso-8859-1

But then adds a 500 error html to the output:
!DOCTYPE HTML PUBLIC -//IETF//DTD HTML 2.0//EN
htmlhead
title200 OK/title
/headbody
h1OK/h1
pThe server encountered an internal error or
misconfiguration and was unable to complete
your request./p
pPlease contact the server administrator,
 [EMAIL PROTECTED] and inform them of the time the error occurred,
and anything you might have done that may have
caused the error./p
pMore information about this error may be available
in the server error log./p
/body/html


Interestingly, a 302 result works correctly. A static page display  
is fine also. I have rebuilt perl  mod_perl since I encountered  
the error to no avail.


2. Used Components and their Configuration:

*** mod_perl version 2.03

*** using /tmp/mod_perl-2.0.3/lib/Apache2/BuildConfig.pm

*** Makefile.PL options:
  MP_APR_LIB = aprext
  MP_APXS= /usr/sbin/apxs
  MP_COMPAT_1X   = 1
  MP_GENERATE_XS = 1
  MP_LIBNAME = mod_perl
  MP_USE_DSO = 1


*** /usr/sbin/httpd -V
Server version: Apache/2.2.6 (Unix)
Server built:   Dec 28 2007 00:27:39
Server's Module Magic Number: 20051115:5
Server loaded:  APR 1.2.11, APR-Util 1.2.10
Compiled using: APR 1.2.11, APR-Util 1.2.10
Architecture:   32-bit
Server MPM: Prefork
  threaded: no
forked: yes (variable process count)
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 DYNAMIC_MODULE_LIMIT=128
 -D HTTPD_ROOT=/usr
 -D SUEXEC_BIN=/usr/bin/suexec
 -D DEFAULT_PIDLOG=/var/run/httpd.pid
 -D DEFAULT_SCOREBOARD=logs/apache_runtime_status
 -D DEFAULT_LOCKFILE=/var/run/accept.lock
 -D DEFAULT_ERRORLOG=logs/error_log
 -D AP_TYPES_CONFIG_FILE=/etc/httpd/conf/mime.types
 -D SERVER_CONFIG_FILE=/etc/httpd/conf/httpd.conf

*** /usr/bin/ldd /usr/sbin/httpd
linux-gate.so.1 =  (0x00e17000)
libm.so.6 = /lib/libm.so.6 (0x00c9e000)
libaprutil-1.so.0 = /usr/lib/libaprutil-1.so.0 (0x00388000)
libpq.so.4 = /usr/lib/libpq.so.4 (0x002b2000)
libsqlite3.so.0 = /usr/lib/libsqlite3.so.0 (0x005ae000)
libexpat.so.0 = /usr/lib/libexpat.so.0 (0x00766000)
libapr-1.so.0 = /usr/lib/libapr-1.so.0 (0x00365000)
libuuid.so.1 = /lib/libuuid.so.1 (0x003ae000)
librt.so.1 = /lib/librt.so.1 (0x003f)
libcrypt.so.1 = /lib/libcrypt.so.1 (0x00cee000)
libpthread.so.0 = /lib/libpthread.so.0 (0x00cda000)
libdl.so.2 = /lib/libdl.so.2 (0x00c98000)
libc.so.6 = /lib/libc.so.6 (0x00b6d000)
/lib/ld-linux.so.2 (0x00b4f000)
libssl.so.5 = /lib/libssl.so.5 (0x00d95000)
libcrypto.so.5 = /lib/libcrypto.so.5 (0x00101000)
libkrb5.so.3 = /usr/lib/libkrb5.so.3 (0x0021)
libresolv.so.2 = /lib/libresolv.so.2 (0x00d1e000)
libnsl.so.1 = /lib/libnsl.so.1 (0x00d33000)
libgssapi_krb5.so.2 = /usr/lib/libgssapi_krb5.so.2 (0x00d5)
libcom_err.so.2 = /lib/libcom_err.so.2 (0x00d4b000)
libk5crypto.so.3 = /usr/lib/libk5crypto.so.3 (0x00d6a000)
libz.so.1 = /usr/lib/libz.so.1 (0x00cc5000)
libkrb5support.so.0 = /usr/lib/libkrb5support.so.0 (0x00d9)


*** (apr|apu)-config linking info

 -L/usr/lib -laprutil-1 -lpq -lsqlite3 -lexpat
 -L/usr/lib -lapr-1 -luuid -lrt -lcrypt  -lpthread -ldl



*** /usr/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
  Platform:
osname=linux, osvers=2.6.14-1.1653_fc4smp, archname=i686-linux
uname='linux nat.longmedia.com 2.6.14-1.1653_fc4smp #1 smp tue  
dec 13 21:46:01 est 2005 i686 i686 i386 gnulinux '

config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef  
usemultiplicity=undef

useperlio=define d_sfio=undef 

Re: resend: [mp2] bug report - heap management error in mod_perl on Windows

2007-12-30 Thread William A. Rowe, Jr.

Randy Kobes wrote:


Hi Tom,
Thanks for the detailed report, and patch. I tried out
the patch with perl-5.8.8, compiled against Apache/2.2.4,
and all the tests passed. However, the restart problem
still remains; evidently,
  http://issues.apache.org/bugzilla/show_bug.cgi?id=43534
or something equivalent must still be applied.


FYI, the latest apr release and httpd 2.2.x branch should now
address things properly.  The only flaw I'm seeing is in the
replacement of piped loggers, and believe that has to do with
close_handle_in_child (a fork-specific thing that's polluting
win32).

Bill


svn commit: r607681 - in /perl/modperl/branches/threading/t: perl/ithreads3.t response/TestPerl/ithreads3.pm

2007-12-30 Thread gozer
Author: gozer
Date: Sun Dec 30 21:55:42 2007
New Revision: 607681

URL: http://svn.apache.org/viewvc?rev=607681view=rev
Log:
Forgot to add the test case for a previous fix.

Reviewed-By: gozer
Submitted-By: Torsten Foertsch [EMAIL PROTECTED]
Message-Id: [EMAIL PROTECTED]


Added:
perl/modperl/branches/threading/t/perl/ithreads3.t
perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm

Added: perl/modperl/branches/threading/t/perl/ithreads3.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/perl/ithreads3.t?rev=607681view=auto
==
--- perl/modperl/branches/threading/t/perl/ithreads3.t (added)
+++ perl/modperl/branches/threading/t/perl/ithreads3.t Sun Dec 30 21:55:42 2007
@@ -0,0 +1,39 @@
+use strict;
+use warnings FATAL = 'all';
+
+use Apache::Test;
+use Apache::TestUtil;
+use Apache::TestRequest 'GET_BODY';
+
+plan tests = 6, need_apache_mpm('worker')  need_perl('ithreads');
+
+my $module = 'TestPerl::ithreads3';
+
+sub u {Apache::TestRequest::module2url($module, {path=$_[0]})}
+sub t {
+  my $rc;
+  eval {
+local $SIG{ALRM}=sub {die Timeout\n};
+alarm 2;
+eval {
+  $rc=GET_BODY u(shift);
+};
+alarm 0;
+  };
+  alarm 0;
+  return $rc;
+}
+
+t_debug(connecting to .u(''));
+ok t_cmp t('/perl-script?1'), 2, 'perl-script 1';
+ok t_cmp t('/modperl?1'), 2, 'modperl 1';
+
+ok t_cmp t('/perl-script?2'), 5, 'perl-script 2';
+ok t_cmp t('/modperl?2'), 5, 'modperl 2';
+
+ok t_cmp t('/perl-script?3'), 3, 'perl-script 3';
+ok t_cmp t('/modperl?3'), 3, 'modperl 3';
+
+# Local Variables: #
+# mode: cperl #
+# End: #

Added: perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm?rev=607681view=auto
==
--- perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm (added)
+++ perl/modperl/branches/threading/t/response/TestPerl/ithreads3.pm Sun Dec 30 
21:55:42 2007
@@ -0,0 +1,108 @@
+package TestPerl::ithreads3;
+
+use strict;
+use warnings FATAL = 'all';
+
+use Apache2::RequestRec;
+use Apache2::RequestIO;
+use Apache2::RequestUtil;
+use APR::Pool;
+use Apache2::Const -compile = 'OK', 'DECLINED';
+
+# XXX: These tests rely on the assumption that the virtual host is not
+#  otherwise accessed. In this case the same interpreter is chosen
+#  for each phase. The $counter counts them.
+#  Of course if only 1 interp is configured it must be hit each time.
+
+my $counter=0;
+
+sub response {
+  my $r=shift;
+  $r-content_type('text/plain');
+  $r-print($counter);
+  return Apache2::Const::OK;
+}
+
+sub count { $counter++; return Apache2::Const::DECLINED; }
+
+sub clear_pool {
+  delete $_[0]-pnotes-{my_pool};
+  return Apache2::Const::DECLINED;
+}
+
+sub trans {
+  my $r=shift;
+  my $test=$r-args;
+  $counter=0;
+  if( $test eq '1' ) {
+# this is to check for a bug in modperl_response_handler versus
+# modperl_response_handler_cgi. The former used to allocate an
+# extra interpreter for its work. In both cases $counter should be
+# 2 in the response phase
+$r-push_handlers( PerlMapToStorageHandler=__PACKAGE__.'::count' );
+$r-push_handlers( PerlFixupHandler=__PACKAGE__.'::count' );
+  }
+  elsif( $test eq '2' ) {
+# now add an extra PerlCleanupHandler. It is run each time the
+# interp is released. So it is run after Trans, MapToStorage and
+# Fixup. In the response phase $counter should be 5. After Response
+# it is run again but that is after.
+# This used to eat up all interpreters because modperl_interp_unselect
+# calls modperl_config_request_cleanup that allocates a new interp
+# to handle the cleanup. When this interp is then unselected
+# modperl_interp_unselect gets called again but the cleanup handler is
+# still installed. So the cycle starts again until all interpreters
+# are in use or the stack runs out. Then the thread is locked infinitely
+# or a segfault appears.
+$r-push_handlers( PerlMapToStorageHandler=__PACKAGE__.'::count' );
+$r-push_handlers( PerlFixupHandler=__PACKAGE__.'::count' );
+$r-push_handlers( PerlCleanupHandler=__PACKAGE__.'::count' );
+  }
+  elsif( $test eq '3' ) {
+# a subpool adds an extra reference to the interp. So it is preserved
+# and bound to the request until the pool is destroyed. So the cleanup
+# handler is run only once after Fixup. Hence the counter is 3.
+$r-push_handlers( PerlMapToStorageHandler=__PACKAGE__.'::count' );
+$r-push_handlers( PerlFixupHandler=__PACKAGE__.'::count' );
+$r-push_handlers( PerlCleanupHandler=__PACKAGE__.'::count' );
+$r-pnotes-{my_pool}=$r-pool-new;
+$r-push_handlers( PerlFixupHandler=__PACKAGE__.'::clear_pool' );
+  }
+  return Apache2::Const::DECLINED;
+}
+
+1;
+
+__END__
+# APACHE_TEST_CONFIG_ORDER 942

svn commit: r607687 - in /perl/modperl/trunk: Changes t/filter/TestFilter/with_subrequest.pm t/filter/with_subrequest.t xs/Apache2/SubRequest/Apache2__SubRequest.h

2007-12-30 Thread gozer
Author: gozer
Date: Sun Dec 30 22:48:57 2007
New Revision: 607687

URL: http://svn.apache.org/viewvc?rev=607687view=rev
Log:
Fix a crash when running a sub-request from within a filter where 
mod_perl was not the content handler.

Running modperl_wbucket_flush(rcfg-wbucket) before the subrequest
is run ensures we've flushed our own content handler if it has
any data in the pipeline. Problem was rcfg-wbucket will not be
set if we are not the content handler.

Solution is to avoid the flush in that particular case.


Added:
perl/modperl/trunk/t/filter/TestFilter/with_subrequest.pm
perl/modperl/trunk/t/filter/with_subrequest.t
Modified:
perl/modperl/trunk/Changes
perl/modperl/trunk/xs/Apache2/SubRequest/Apache2__SubRequest.h

Modified: perl/modperl/trunk/Changes
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/Changes?rev=607687r1=607686r2=607687view=diff
==
--- perl/modperl/trunk/Changes (original)
+++ perl/modperl/trunk/Changes Sun Dec 30 22:48:57 2007
@@ -12,6 +12,9 @@
 
 =item 2.0.4-dev
 
+Fix a crash when running a sub-request from within a filter where
+mod_perl was not the content handler. [Gozer]
+
 Refactor tests to use keepalives instead of same_interp [Gozer, Phred]
 
 Apache2::Reload has been moved to an externally maintained

Added: perl/modperl/trunk/t/filter/TestFilter/with_subrequest.pm
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/filter/TestFilter/with_subrequest.pm?rev=607687view=auto
==
--- perl/modperl/trunk/t/filter/TestFilter/with_subrequest.pm (added)
+++ perl/modperl/trunk/t/filter/TestFilter/with_subrequest.pm Sun Dec 30 
22:48:57 2007
@@ -0,0 +1,38 @@
+package TestFilter::with_subrequest;
+
+use strict;
+use warnings FATAL = 'all';
+
+use Apache2::Filter ();
+use Apache2::SubRequest ();
+
+use TestCommon::Utils;
+
+use Apache2::Const -compile = 'OK';
+
+sub handler {
+my $f = shift;
+my $r = $f-r;
+
+my $subr;
+while ($f-read(my $buffer, 1024)) {
+$f-print(lc $buffer);
+   if (!$subr) {
+$subr = $r-lookup_uri($r-uri);
+my $rc = $subr-run;
+}
+}
+
+Apache2::Const::OK;
+}
+
+1;
+__DATA__
+
+Location /with_subrequest
+  PerlOutputFilterHandler TestFilter::with_subrequest
+/Location
+
+IfModule mod_alias.c
+Alias /with_subrequest @top_dir@
+/IfModule

Added: perl/modperl/trunk/t/filter/with_subrequest.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/filter/with_subrequest.t?rev=607687view=auto
==
--- perl/modperl/trunk/t/filter/with_subrequest.t (added)
+++ perl/modperl/trunk/t/filter/with_subrequest.t Sun Dec 30 22:48:57 2007
@@ -0,0 +1,13 @@
+use strict;
+use warnings FATAL = 'all';
+
+use Apache::Test;
+use Apache::TestRequest;
+
+plan tests = 1, need 'mod_alias';
+
+my $location = /with_subrequest/Makefile;
+
+my $str = GET_BODY $location;
+
+ok $str !~ /[A-Z]/;

Modified: perl/modperl/trunk/xs/Apache2/SubRequest/Apache2__SubRequest.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/SubRequest/Apache2__SubRequest.h?rev=607687r1=607686r2=607687view=diff
==
--- perl/modperl/trunk/xs/Apache2/SubRequest/Apache2__SubRequest.h (original)
+++ perl/modperl/trunk/xs/Apache2/SubRequest/Apache2__SubRequest.h Sun Dec 30 
22:48:57 2007
@@ -23,8 +23,10 @@
 
 if (r-main) {
 modperl_config_req_t *rcfg = modperl_config_req_get(r-main);
-MP_RUN_CROAK(modperl_wbucket_flush(rcfg-wbucket, FALSE),
- Apache2::SubRequest::run);
+if (rcfg-wbucket) {
+MP_RUN_CROAK(modperl_wbucket_flush(rcfg-wbucket, FALSE),
+ Apache2::SubRequest::run);
+}
 }
 
 return ap_run_sub_req(r);




svn commit: r607690 [2/2] - in /perl/modperl/trunk: src/modules/perl/ xs/ xs/APR/Base64/ xs/APR/Brigade/ xs/APR/Bucket/ xs/APR/BucketAlloc/ xs/APR/Error/ xs/APR/Finfo/ xs/APR/Lock/ xs/APR/PerlIO/ xs/A

2007-12-30 Thread gozer
Modified: perl/modperl/trunk/xs/Apache2/Module/Apache2__Module.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/Module/Apache2__Module.h?rev=607690r1=607689r2=607690view=diff
==
--- perl/modperl/trunk/xs/Apache2/Module/Apache2__Module.h (original)
+++ perl/modperl/trunk/xs/Apache2/Module/Apache2__Module.h Sun Dec 30 23:20:50 
2007
@@ -75,7 +75,7 @@
 return mod-minor_version;
 }
 
-static MP_INLINE void mpxs_Apache2__Module_add(pTHX_ 
+static MP_INLINE void mpxs_Apache2__Module_add(pTHX_
   char *package,
   SV *cmds)
 {
@@ -90,7 +90,7 @@
 error = modperl_module_add(s-process-pconf, s, package, cmds);
 
 if (error) {
-Perl_croak(aTHX_ Apache2::Module::add(%s) failed : %s, 
+Perl_croak(aTHX_ Apache2::Module::add(%s) failed : %s,
package, error);
 }
 

Modified: perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h?rev=607690r1=607689r2=607690view=diff
==
--- perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestIO/Apache2__RequestIO.h Sun Dec 30 
23:20:50 2007
@@ -97,7 +97,7 @@
 mpxs_output_flush(r, rcfg, Apache2::RequestIO::print);
 
 return bytes ? newSVuv(bytes) : newSVpvn(0E0, 3);
-}  
+}
 
 static MP_INLINE
 apr_size_t mpxs_ap_rprintf(pTHX_ I32 items, SV **MARK, SV **SP)
@@ -129,7 +129,7 @@
 mpxs_output_flush(r, rcfg, Apache2::RequestIO::printf);
 
 return bytes;
-}  
+}
 
 /* alias */
 #define mpxs_Apache2__RequestRec_WRITE(r, buffer, len, offset) \
@@ -252,7 +252,7 @@
 
 if (total  0) {
 mpxs_sv_cur_set(buffer, offset+total);
-} 
+}
 else {
 sv_setpvn(buffer, , 0);
 }

Modified: perl/modperl/trunk/xs/Apache2/RequestRec/Apache2__RequestRec.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/RequestRec/Apache2__RequestRec.h?rev=607690r1=607689r2=607690view=diff
==
--- perl/modperl/trunk/xs/Apache2/RequestRec/Apache2__RequestRec.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestRec/Apache2__RequestRec.h Sun Dec 30 
23:20:50 2007
@@ -35,10 +35,10 @@
 SV *mpxs_Apache2__RequestRec_content_languages(pTHX_ request_rec *r,
   SV *languages)
 {
-SV *retval = modperl_apr_array_header2avrv(aTHX_ 
+SV *retval = modperl_apr_array_header2avrv(aTHX_
r-content_languages);
 if (languages) {
-r-content_languages = modperl_avrv2apr_array_header(aTHX_ 
+r-content_languages = modperl_avrv2apr_array_header(aTHX_
  r-pool,
  languages);
 }
@@ -52,11 +52,11 @@
 
 if (!val  !r-proxyreq 
 r-parsed_uri.scheme 
-   !(r-parsed_uri.hostname  
+   !(r-parsed_uri.hostname 
  strEQ(r-parsed_uri.scheme, ap_http_scheme(r)) 
  ap_matches_request_vhost(r, r-parsed_uri.hostname,
-   r-parsed_uri.port_str ? 
-   r-parsed_uri.port : 
+   r-parsed_uri.port_str ?
+   r-parsed_uri.port :
ap_default_port(r
 {
 retval = r-proxyreq = 1;
@@ -146,5 +146,3 @@
 
 return RETVAL;
 }
-
-

Modified: perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h?rev=607690r1=607689r2=607690view=diff
==
--- perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h (original)
+++ perl/modperl/trunk/xs/Apache2/RequestUtil/Apache2__RequestUtil.h Sun Dec 30 
23:20:50 2007
@@ -81,7 +81,7 @@
 r-server = s;
 
 r-request_time = apr_time_now();
-
+
 r-user= NULL;
 r-ap_auth_type= NULL;
 
@@ -125,7 +125,7 @@
 if (base_pool_sv) {
 mpxs_add_pool_magic(r_sv, base_pool_sv);
 }
-
+
 return r_sv;
 }
 
@@ -320,7 +320,7 @@
 struct mp_docroot_info *di;
 core_server_config *conf;
 MP_CROAK_IF_THREADS_STARTED(setting $r-document_root);
-conf = ap_get_module_config(r-server-module_config, 
+conf = ap_get_module_config(r-server-module_config,
 core_module);
 di = apr_palloc(r-pool, sizeof *di);
 di-docroot = conf-ap_document_root;
@@ -340,7 +340,7 @@
 /* On the first pass, 

svn commit: r607692 - in /perl/modperl/trunk: src/modules/perl/ xs/APR/Socket/ xs/Apache2/Directive/ xs/Apache2/RequestRec/

2007-12-30 Thread gozer
Author: gozer
Date: Sun Dec 30 23:31:16 2007
New Revision: 607692

URL: http://svn.apache.org/viewvc?rev=607692view=rev
Log:
*Whitespace*

expands tabs in C files

Reviewed-by: gozer
Submitted-by: Torsten Foertsch [EMAIL PROTECTED]
Message-Id: [EMAIL PROTECTED]

Modified:
perl/modperl/trunk/src/modules/perl/modperl_config.h
perl/modperl/trunk/src/modules/perl/modperl_io.c
perl/modperl/trunk/src/modules/perl/modperl_svptr_table.c
perl/modperl/trunk/src/modules/perl/modperl_util.c
perl/modperl/trunk/xs/APR/Socket/APR__Socket.h
perl/modperl/trunk/xs/Apache2/Directive/Apache2__Directive.h
perl/modperl/trunk/xs/Apache2/RequestRec/Apache2__RequestRec.h

Modified: perl/modperl/trunk/src/modules/perl/modperl_config.h
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_config.h?rev=607692r1=607691r2=607692view=diff
==
--- perl/modperl/trunk/src/modules/perl/modperl_config.h (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_config.h Sun Dec 30 23:31:16 
2007
@@ -48,9 +48,9 @@
  */
 #define modperl_config_req_cleanup_register(r, rcfg)   \
 if (r  !MpReqCLEANUP_REGISTERED(rcfg)) { \
-apr_pool_t *p;\
-apr_pool_create(p, r-pool); \
-apr_pool_cleanup_register(p,  \
+apr_pool_t *p;   \
+apr_pool_create(p, r-pool);   \
+apr_pool_cleanup_register(p,   \
   (void*)r,\
   modperl_config_req_cleanup,  \
   apr_pool_cleanup_null);  \

Modified: perl/modperl/trunk/src/modules/perl/modperl_io.c
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_io.c?rev=607692r1=607691r2=607692view=diff
==
--- perl/modperl/trunk/src/modules/perl/modperl_io.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_io.c Sun Dec 30 23:31:16 2007
@@ -80,12 +80,12 @@
 SV *sv = TIEHANDLE_SV(handle);
 
 if (SvMAGICAL(sv)  (mg = mg_find(sv, PERL_MAGIC_tiedscalar))) {
-   char *package = HvNAME(SvSTASH((SV*)SvRV(mg-mg_obj)));
+char *package = HvNAME(SvSTASH((SV*)SvRV(mg-mg_obj)));
 
-   if (!strEQ(package, classname)) {
-   MP_TRACE_r(MP_FUNC, %s tied to %s\n, GvNAME(handle), package);
-   return TRUE;
-   }
+if (!strEQ(package, classname)) {
+MP_TRACE_r(MP_FUNC, %s tied to %s\n, GvNAME(handle), package);
+return TRUE;
+}
 }
 
 return FALSE;

Modified: perl/modperl/trunk/src/modules/perl/modperl_svptr_table.c
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/src/modules/perl/modperl_svptr_table.c?rev=607692r1=607691r2=607692view=diff
==
--- perl/modperl/trunk/src/modules/perl/modperl_svptr_table.c (original)
+++ perl/modperl/trunk/src/modules/perl/modperl_svptr_table.c Sun Dec 30 
23:31:16 2007
@@ -55,8 +55,8 @@
 CLONE_PARAMS parms;
 
 Newz(0, tbl, 1, PTR_TBL_t);
-tbl-tbl_max   = source-tbl_max;
-tbl-tbl_items = source-tbl_items;
+tbl-tbl_max= source-tbl_max;
+tbl-tbl_items= source-tbl_items;
 Newz(0, tbl-tbl_ary, tbl-tbl_max + 1, PTR_TBL_ENT_t *);
 
 dst_ary = tbl-tbl_ary;
@@ -67,13 +67,13 @@
 parms.stashes = newAV();
 
 for (i=0; i  source-tbl_max; i++, dst_ary++, src_ary++) {
-   PTR_TBL_ENT_t *src_ent, *dst_ent=NULL;
+PTR_TBL_ENT_t *src_ent, *dst_ent=NULL;
 
-   if (!*src_ary) {
-   continue;
+if (!*src_ary) {
+continue;
 }
 
-   for (src_ent = *src_ary;
+for (src_ent = *src_ary;
  src_ent;
  src_ent = src_ent-next)
 {
@@ -110,13 +110,13 @@
 PTR_TBL_ENT_t **ary = tbl-tbl_ary;
 
 for (i=0; i  tbl-tbl_max; i++, ary++) {
-   PTR_TBL_ENT_t *ent;
+PTR_TBL_ENT_t *ent;
 
-   if (!*ary) {
-   continue;
+if (!*ary) {
+continue;
 }
 
-   for (ent = *ary; ent; ent = ent-next) {
+for (ent = *ary; ent; ent = ent-next) {
 if (!ent-newval) {
 continue;
 }
@@ -143,13 +143,13 @@
 entry = *oentry;
 
 for (; entry; oentry = entry-next, entry = *oentry) {
-   if (entry-oldval == key) {
+if (entry-oldval == key) {
 *oentry = entry-next;
 SvREFCNT_dec((SV*)entry-newval);
 Safefree(entry);
 tbl-tbl_items--;
-   return;
-   }
+return;
+}
 }
 }
 
@@ -168,8 +168,8 @@
 {
 PTR_TBL_t *tbl;
 Newz(0, tbl, 1, PTR_TBL_t);
-tbl-tbl_max   = 511;
-

svn commit: r607693 - in /perl/modperl/trunk/t: apache/ apr-ext/ directive/ filter/ hooks/ modperl/ perl/ protocol/

2007-12-30 Thread gozer
Author: gozer
Date: Sun Dec 30 23:36:46 2007
New Revision: 607693

URL: http://svn.apache.org/viewvc?rev=607693view=rev
Log:
*Whitespace*

removes trailing whitespace and expands tabs in t/*.t

Reviewed-by: gozer
Submitted-by: Torsten Foertsch [EMAIL PROTECTED]
Message-Id: [EMAIL PROTECTED]

Modified:
perl/modperl/trunk/t/apache/constants.t
perl/modperl/trunk/t/apache/content_length_header.t
perl/modperl/trunk/t/apr-ext/perlio.t
perl/modperl/trunk/t/apr-ext/uuid.t
perl/modperl/trunk/t/directive/perl.t
perl/modperl/trunk/t/filter/out_str_req_mix.t
perl/modperl/trunk/t/hooks/push_handlers.t
perl/modperl/trunk/t/modperl/cookie.t
perl/modperl/trunk/t/modperl/pnotes2.t
perl/modperl/trunk/t/perl/hash_attack.t
perl/modperl/trunk/t/protocol/eliza.t

Modified: perl/modperl/trunk/t/apache/constants.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/apache/constants.t?rev=607693r1=607692r2=607693view=diff
==
--- perl/modperl/trunk/t/apache/constants.t (original)
+++ perl/modperl/trunk/t/apache/constants.t Sun Dec 30 23:36:46 2007
@@ -8,7 +8,7 @@
 # -compile puts constants into the Apache2:: namespace
 use Apache2::Const -compile = qw(:http :common :mpmq :proxy
   TAKE23 OPT_EXECCGI
-  DECLINE_CMD DIR_MAGIC_TYPE 
+  DECLINE_CMD DIR_MAGIC_TYPE
   CRLF);
 
 # without -compile, constants are in the
@@ -29,11 +29,11 @@
 
 ok t_cmp(Apache2::Const::HTTP_GONE, 410, 'Apache2::Const::HTTP_GONE');
 
-ok t_cmp(Apache2::Const::DIR_MAGIC_TYPE, 
+ok t_cmp(Apache2::Const::DIR_MAGIC_TYPE,
  'httpd/unix-directory',
  'Apache2::Const::DIR_MAGIC_TYPE');
 
-ok t_cmp(Apache2::Const::MPMQ_MAX_SPARE_DAEMONS, 
+ok t_cmp(Apache2::Const::MPMQ_MAX_SPARE_DAEMONS,
  9,
  'Apache2::Const::MPMQ_MAX_SPARE_DAEMONS');
 

Modified: perl/modperl/trunk/t/apache/content_length_header.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/apache/content_length_header.t?rev=607693r1=607692r2=607693view=diff
==
--- perl/modperl/trunk/t/apache/content_length_header.t (original)
+++ perl/modperl/trunk/t/apache/content_length_header.t Sun Dec 30 23:36:46 2007
@@ -72,13 +72,13 @@
 ## to protect against wierd SVN checkout building.
 ## XXX: I'm starting to think this test is more
 ## trouble then its worth.
-if (have_min_apache_version(2.2.1)) { 
+if (have_min_apache_version(2.2.1)) {
   $head_cl = 25;
 }
 elsif (have_min_apache_version(2.2.0)) {
   # $head_cl = undef; # avoid warnings
 }
-elsif (have_min_apache_version(2.0.56)) { 
+elsif (have_min_apache_version(2.0.56)) {
   $head_cl = 25;
 }
 else {

Modified: perl/modperl/trunk/t/apr-ext/perlio.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/apr-ext/perlio.t?rev=607693r1=607692r2=607693view=diff
==
--- perl/modperl/trunk/t/apr-ext/perlio.t (original)
+++ perl/modperl/trunk/t/apr-ext/perlio.t Sun Dec 30 23:36:46 2007
@@ -25,7 +25,7 @@
 # prerequisite
 # also need to check whether we build against the source tree, in
 # which case we APR.so won't be linked against libapr/libaprutil
-my $has_apr_config = $build-{apr_config_path}  
+my $has_apr_config = $build-{apr_config_path} 
 !$build-httpd_is_source_tree;
 
 my $has_perlio_layers = 0;
@@ -230,11 +230,11 @@
 }
 
 
-# XXX: need tests 
+# XXX: need tests
 # - for stdin/out/err as they are handled specially
 
 # XXX: tmpfile is missing:
-# consider to use 5.8's syntax: 
+# consider to use 5.8's syntax:
 #   open $fh, +, undef;
 
 # cleanup: t_mkdir will remove the whole tree including the file

Modified: perl/modperl/trunk/t/apr-ext/uuid.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/apr-ext/uuid.t?rev=607693r1=607692r2=607693view=diff
==
--- perl/modperl/trunk/t/apr-ext/uuid.t (original)
+++ perl/modperl/trunk/t/apr-ext/uuid.t Sun Dec 30 23:36:46 2007
@@ -16,7 +16,7 @@
 ###
 # my $build = Apache2::Build-build_config;
 #
-# my $has_apr_config = $build-{apr_config_path}  
+# my $has_apr_config = $build-{apr_config_path} 
 #!$build-httpd_is_source_tree;
 # plan tests = TestAPRlib::uuid::num_of_tests(),
 #need {the build couldn't find apr-config = $has_apr_config};

Modified: perl/modperl/trunk/t/directive/perl.t
URL: 
http://svn.apache.org/viewvc/perl/modperl/trunk/t/directive/perl.t?rev=607693r1=607692r2=607693view=diff
==
--- perl/modperl/trunk/t/directive/perl.t (original)
+++ perl/modperl/trunk/t/directive/perl.t Sun Dec 30