You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by to...@apache.org on 2011/05/12 06:43:17 UTC

svn commit: r1102166 - in /perl/modperl/branches/threading: ./ src/modules/perl/ t/api/ t/filter/TestFilter/ t/protocol/TestProtocol/ t/response/TestAPI/ xs/Apache2/RequestUtil/

Author: torsten
Date: Thu May 12 04:43:17 2011
New Revision: 1102166

URL: http://svn.apache.org/viewvc?rev=1102166&view=rev
Log:
Merged revisions 1089349,1089363,1089411,1089414,1096560,1096564-1096565 via svnmerge from 
https://svn.eu.apache.org/repos/asf/perl/modperl/trunk

........
  r1089349 | torsten | 2011-04-06 10:29:23 +0200 (Wed, 06 Apr 2011) | 1 line
  
  HTTP::Headers at least in version 6.00 does not translate underscores to minus when storing headers but does so when they are read.
........
  r1089363 | torsten | 2011-04-06 11:02:45 +0200 (Wed, 06 Apr 2011) | 1 line
  
  next try: restrict localization of $HTTP::Headers::TRANSLATE_UNDERSCORE to HTTP::Headers 6.00 only
........
  r1089411 | torsten | 2011-04-06 13:47:18 +0200 (Wed, 06 Apr 2011) | 1 line
  
  LWP 6.x uses HTTP/1.1 but t/response/TestAPI/request_rec.pm assumes it is always called using HTTP/1.0
........
  r1089414 | torsten | 2011-04-06 13:54:53 +0200 (Wed, 06 Apr 2011) | 1 line
  
  fixed a wrong content-length header in t/filter/TestFilter/out_str_reverse.pm
........
  r1096560 | torsten | 2011-04-25 20:51:25 +0200 (Mon, 25 Apr 2011) | 1 line
  
  Modules that add directives should be loaded via PerlLoadModule
........
  r1096564 | torsten | 2011-04-25 21:01:15 +0200 (Mon, 25 Apr 2011) | 1 line
  
  avoid a superfluous module list scan in modperl_module_insert()
........
  r1096565 | torsten | 2011-04-25 21:04:58 +0200 (Mon, 25 Apr 2011) | 1 line
  
  remove hard coded AuthType and AuthName from Apache2__RequestUtil.h
........

Modified:
    perl/modperl/branches/threading/   (props changed)
    perl/modperl/branches/threading/Changes
    perl/modperl/branches/threading/src/modules/perl/modperl_module.c
    perl/modperl/branches/threading/t/api/err_headers_out.t
    perl/modperl/branches/threading/t/filter/TestFilter/out_str_reverse.pm
    perl/modperl/branches/threading/t/protocol/TestProtocol/pseudo_http.pm
    perl/modperl/branches/threading/t/response/TestAPI/add_config.pm
    perl/modperl/branches/threading/t/response/TestAPI/request_rec.pm
    perl/modperl/branches/threading/xs/Apache2/RequestUtil/Apache2__RequestUtil.h

Propchange: perl/modperl/branches/threading/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu May 12 04:43:17 2011
@@ -1 +1 @@
-/perl/modperl/trunk:594682-672484,672819-681118,693357,700369,732889-736218,751909-752425,757553-774171,807116,807332-807649,907778-932879,933373-933563,935519,936643,940287,957309-983073,985740,987933-1023553,1029211-1052232,1062311-1062448,1066644-1074122,1076733,1083541
+/perl/modperl/trunk:594682-672484,672819-681118,693357,700369,732889-736218,751909-752425,757553-774171,807116,807332-807649,907778-932879,933373-933563,935519,936643,940287,957309-983073,985740,987933-1023553,1029211-1052232,1062311-1062448,1066644-1074122,1076733,1083541,1089349-1096565

Propchange: perl/modperl/branches/threading/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu May 12 04:43:17 2011
@@ -1 +1 @@
-/perl/modperl/trunk:1-712967,712969-1083541
+/perl/modperl/trunk:1-712967,712969-1102165

Modified: perl/modperl/branches/threading/Changes
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/Changes?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/Changes (original)
+++ perl/modperl/branches/threading/Changes Thu May 12 04:43:17 2011
@@ -31,6 +31,12 @@ Expose modperl_interp_t via ModPerl::Int
 
 =item 2.0.6-dev
 
+Fixed a few issues that came up with LWP 6.00:
+- t/response/TestAPI/request_rec.pm assumes HTTP/1.0 but LWP 6 uses 1.1
+- t/api/err_headers_out.t fails due to a bug somewhere in LWP 6
+- t/filter/TestFilter/out_str_reverse.pm sends the wrong content-length header
+[Torsten Foertsch]
+
 Bugfix: Apache2::ServerUtil::get_server{description,banner,version} cannot
 be declared as perl constants or they won't reflect added version components
 if Apache2::ServerUtil is loaded before the PostConfig phase. Now, they

Modified: perl/modperl/branches/threading/src/modules/perl/modperl_module.c
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/src/modules/perl/modperl_module.c?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/src/modules/perl/modperl_module.c (original)
+++ perl/modperl/branches/threading/src/modules/perl/modperl_module.c Thu May 12 04:43:17 2011
@@ -759,8 +759,6 @@ static const char *modperl_module_add_cm
 
 static void modperl_module_insert(module *modp)
 {
-    module *m;
-
     /*
      * insert after mod_perl, rather the top of the list.
      * (see ap_add_module; does not insert into ap_top_module list if
@@ -768,14 +766,8 @@ static void modperl_module_insert(module
      * this way, modperl config merging happens before this module.
      */
 
-    for (m = ap_top_module; m; m=m->next) {
-        if (m == &perl_module) {
-            module *next = m->next;
-            m->next = modp;
-            modp->next = next;
-            break;
-        }
-    }
+    modp->next = perl_module.next;
+    perl_module.next = modp;
 }
 
 #define MP_isGV(gv) (gv && isGV(gv))

Modified: perl/modperl/branches/threading/t/api/err_headers_out.t
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/api/err_headers_out.t?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/api/err_headers_out.t (original)
+++ perl/modperl/branches/threading/t/api/err_headers_out.t Thu May 12 04:43:17 2011
@@ -20,6 +20,14 @@ my $location = '/TestAPI__err_headers_ou
 
     ok t_cmp $res->code, 200, "OK";
 
+    # HTTP::Headers 6.00 makes the next 2 tests fail. When the response comes
+    # in the header name is stored as "x-err_headers_out". But when it is to
+    # be read below it is referred as "x-err-headers-out" and hence not found.
+    local $HTTP::Headers::TRANSLATE_UNDERSCORE=
+	$HTTP::Headers::TRANSLATE_UNDERSCORE;
+    undef $HTTP::Headers::TRANSLATE_UNDERSCORE
+	if defined HTTP::Headers->VERSION and HTTP::Headers->VERSION==6.00;
+
     ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
         "X-err_headers_out: made it";
 
@@ -37,6 +45,14 @@ my $location = '/TestAPI__err_headers_ou
 
     ok t_cmp $res->code, 404, "not found";
 
+    # HTTP::Headers 6.00 makes this test fail. When the response comes in
+    # the header name is stored as "x-err_headers_out". But when it is to
+    # be read below it is referred as "x-err-headers-out" and hence not found.
+    local $HTTP::Headers::TRANSLATE_UNDERSCORE=
+	$HTTP::Headers::TRANSLATE_UNDERSCORE;
+    undef $HTTP::Headers::TRANSLATE_UNDERSCORE
+	if defined HTTP::Headers->VERSION and HTTP::Headers->VERSION==6.00;
+
     ok t_cmp $res->header('X-err_headers_out'), "err_headers_out",
         "X-err_headers_out: made it";
 

Modified: perl/modperl/branches/threading/t/filter/TestFilter/out_str_reverse.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/filter/TestFilter/out_str_reverse.pm?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/filter/TestFilter/out_str_reverse.pm (original)
+++ perl/modperl/branches/threading/t/filter/TestFilter/out_str_reverse.pm Thu May 12 04:43:17 2011
@@ -17,12 +17,21 @@ use TestCommon::Utils ();
 use Apache2::Const -compile => qw(OK M_POST);
 
 use constant BUFF_LEN => 2;
+use constant signature => "Reversed by mod_perl 2.0\n";
 
 sub handler {
     my $f = shift;
     #warn "called\n";
 
     my $leftover = $f->ctx;
+
+    # We are about to change the length of the response body. Hence, we
+    # have to adjust the content-length header.
+    unless (defined $leftover) { # 1st invocation
+	$f->r->headers_out->{'Content-Length'}+=length signature
+	    if exists $f->r->headers_out->{'Content-Length'};
+    }
+
     while ($f->read(my $buffer, BUFF_LEN)) {
         #warn "buffer: [$buffer]\n";
         $buffer = $leftover . $buffer if defined $leftover;
@@ -35,7 +44,7 @@ sub handler {
 
     if ($f->seen_eos) {
         $f->print(scalar reverse $leftover) if defined $leftover;
-        $f->print("Reversed by mod_perl 2.0\n");
+        $f->print(signature);
     }
     else {
         $f->ctx($leftover) if defined $leftover;

Modified: perl/modperl/branches/threading/t/protocol/TestProtocol/pseudo_http.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/protocol/TestProtocol/pseudo_http.pm?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/protocol/TestProtocol/pseudo_http.pm (original)
+++ perl/modperl/branches/threading/t/protocol/TestProtocol/pseudo_http.pm Thu May 12 04:43:17 2011
@@ -166,6 +166,8 @@ __END__
           AuthUserFile @ServerRoot@/htdocs/protocols/basic-auth
       </IfModule>
 
+      AuthName TestProtocol::pseudo_http
+      AuthType Basic
       Require user stas
       Satisfy any
 

Modified: perl/modperl/branches/threading/t/response/TestAPI/add_config.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/response/TestAPI/add_config.pm?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/response/TestAPI/add_config.pm (original)
+++ perl/modperl/branches/threading/t/response/TestAPI/add_config.pm Thu May 12 04:43:17 2011
@@ -122,7 +122,7 @@ __END__
 # APACHE_TEST_CONFIG_ORDER 950
 <NoAutoConfig>
     <VirtualHost TestAPI::add_config>
-        PerlModule TestAPI::add_config
+        PerlLoadModule TestAPI::add_config
         AccessFileName htaccess
         SetHandler modperl
         <Directory @DocumentRoot@>

Modified: perl/modperl/branches/threading/t/response/TestAPI/request_rec.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/t/response/TestAPI/request_rec.pm?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/t/response/TestAPI/request_rec.pm (original)
+++ perl/modperl/branches/threading/t/response/TestAPI/request_rec.pm Thu May 12 04:43:17 2011
@@ -58,8 +58,9 @@ sub handler {
 
     ok $r->protocol =~ /http/i;
 
-    # HTTP 1.0
-    ok t_cmp $r->proto_num, 1000, 't->proto_num';
+    # LWP >=6.00 uses HTTP/1.1, other HTTP/1.0
+    ok t_cmp $r->proto_num, 1000+substr($r->the_request, -1),
+	't->proto_num';
 
     ok t_cmp lc($r->hostname), lc($r->get_server_name), '$r->hostname';
 
@@ -125,7 +126,12 @@ sub handler {
 
         ok t_cmp $r->args, $args, '$r->args';
 
-        ok t_cmp $r->the_request, "GET $base_uri$path_info?$args HTTP/1.0",
+	# LWP uses HTTP/1.1 since 6.00
+        ok t_cmp $r->the_request, qr!GET
+				     \x20
+				     \Q$base_uri$path_info\E\?\Q$args\E
+				     \x20
+				     HTTP/1\.\d!x,
             '$r->the_request';
 
         {

Modified: perl/modperl/branches/threading/xs/Apache2/RequestUtil/Apache2__RequestUtil.h
URL: http://svn.apache.org/viewvc/perl/modperl/branches/threading/xs/Apache2/RequestUtil/Apache2__RequestUtil.h?rev=1102166&r1=1102165&r2=1102166&view=diff
==============================================================================
--- perl/modperl/branches/threading/xs/Apache2/RequestUtil/Apache2__RequestUtil.h (original)
+++ perl/modperl/branches/threading/xs/Apache2/RequestUtil/Apache2__RequestUtil.h Thu May 12 04:43:17 2011
@@ -154,12 +154,6 @@ int mpxs_Apache2__RequestRec_location_me
                                                     &core_module);
 
         if (strEQ(entry->d, location)) {
-            if (!entry->ap_auth_type) {
-                entry->ap_auth_type = "Basic";
-            }
-            if (!entry->ap_auth_name) {
-                entry->ap_auth_name = apr_pstrdup(p, location);
-            }
             r->per_dir_config =
                 ap_merge_per_dir_configs(p, s->lookup_defaults, sec[i]);
             return 1;