Re: Fwd: All responses are 200 (server error)

2010-09-28 Thread William A. Rowe Jr.
On 9/28/2010 12:25 AM, Nico Coetzee wrote:
 The status 400 (with $r-status_line) produces the same result HTTP/1.1 200 
 OK and with
 ($r-status) is creates a HTTP/1.1 400 Bad Request (the custom string gets 
 lost)
 
 The $r-status with a code of 499 produces a HTTP/1.1 400 Bad Request

Sort of confirms my theory.

Set status to 400 and set status_line to 400 Custom Message, see what happens?

I suspect that 499 simply isn't allowed, which is wrong, but the current
behavior none the less.


Re: Fwd: All responses are 200 (server error)

2010-09-28 Thread Nico Coetzee
$r-status(400);
$r-status_line(400 Error Baby);

Produces: HTTP/1.1 400 Error Baby

And

$r-status(207);
$r-status_line(207 Multi-Status);

Produces: HTTP/1.1 207 Multi-Status

So, I recon I will try this now in the main app.

Thanks :-)



On Tue, Sep 28, 2010 at 8:26 AM, William A. Rowe Jr. wr...@rowe-clan.netwrote:

 On 9/28/2010 12:25 AM, Nico Coetzee wrote:
  The status 400 (with $r-status_line) produces the same result HTTP/1.1
 200 OK and with
  ($r-status) is creates a HTTP/1.1 400 Bad Request (the custom string
 gets lost)
 
  The $r-status with a code of 499 produces a HTTP/1.1 400 Bad Request

 Sort of confirms my theory.

 Set status to 400 and set status_line to 400 Custom Message, see what
 happens?

 I suspect that 499 simply isn't allowed, which is wrong, but the current
 behavior none the less.



Re: Fwd: All responses are 200 (server error)

2010-09-28 Thread Nico Coetzee
and... it works now !!



On Tue, Sep 28, 2010 at 8:30 AM, Nico Coetzee nicc...@gmail.com wrote:

 $r-status(400);
 $r-status_line(400 Error Baby);

 Produces: HTTP/1.1 400 Error Baby

 And

 $r-status(207);
 $r-status_line(207 Multi-Status);

 Produces: HTTP/1.1 207 Multi-Status

 So, I recon I will try this now in the main app.

 Thanks :-)



 On Tue, Sep 28, 2010 at 8:26 AM, William A. Rowe Jr. 
 wr...@rowe-clan.netwrote:

 On 9/28/2010 12:25 AM, Nico Coetzee wrote:
  The status 400 (with $r-status_line) produces the same result HTTP/1.1
 200 OK and with
  ($r-status) is creates a HTTP/1.1 400 Bad Request (the custom string
 gets lost)
 
  The $r-status with a code of 499 produces a HTTP/1.1 400 Bad Request

 Sort of confirms my theory.

 Set status to 400 and set status_line to 400 Custom Message, see what
 happens?

 I suspect that 499 simply isn't allowed, which is wrong, but the current
 behavior none the less.





Re: Fwd: All responses are 200 (server error)

2010-09-28 Thread William A. Rowe Jr.
On 9/28/2010 1:32 AM, Nico Coetzee wrote:
 and... it works now !!

I'd hit the same bug from CGI some half-decade ago, sorry I didn't
see where the problem was in the first place :(


svn commit: r1002458 - in /perl/Apache-SizeLimit/trunk: Changes lib/Apache/SizeLimit.pm lib/Apache/SizeLimit/Core.pm lib/Apache2/SizeLimit.pm

2010-09-28 Thread phred
Author: phred
Date: Wed Sep 29 03:50:07 2010
New Revision: 1002458

URL: http://svn.apache.org/viewvc?rev=1002458view=rev
Log:
Add warnings.

Fix a large uncaught bug with 0.92.

Modified:
perl/Apache-SizeLimit/trunk/Changes
perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm
perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm
perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm

Modified: perl/Apache-SizeLimit/trunk/Changes
URL: 
http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/Changes?rev=1002458r1=1002457r2=1002458view=diff
==
--- perl/Apache-SizeLimit/trunk/Changes (original)
+++ perl/Apache-SizeLimit/trunk/Changes Wed Sep 29 03:50:07 2010
@@ -6,9 +6,12 @@ Changes - Apache::SizeLimit change logfi
 
 =over 6
 
-=item 0.93-dev
-
+=item 0.93-rc1
 
+Fix overlooked bug where handler expected to be called as a method handler,
+but was documented to be called like a normal Perl cleanup handler ala
+'PerlCleanupHandler Apache2::SizeLimit'
+[Fred Moyer f...@redhotpenguin.com
 
 =item 0.92 2010-09-23
 

Modified: perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm
URL: 
http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm?rev=1002458r1=1002457r2=1002458view=diff
==
--- perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm (original)
+++ perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit.pm Wed Sep 29 03:50:07 2010
@@ -16,6 +16,8 @@
 package Apache::SizeLimit;
 
 use strict;
+use warnings;
+
 use Config;
 
 use Apache::Constants ();
@@ -24,7 +26,7 @@ use constant IS_WIN32 = $Config{'osname
 
 use vars qw($VERSION);
 
-$VERSION = '0.93-dev';
+$VERSION = '0.93-rc1';
 
 use Apache::SizeLimit::Core qw(
  $MAX_PROCESS_SIZE
@@ -41,18 +43,17 @@ use vars qw(@ISA);
 
 __PACKAGE__-set_check_interval(1);
 
-sub handler ($$) {
-my $class = shift;
+sub handler {
 my $r = shift || Apache-request;
 
 return Apache::Constants::DECLINED() unless $r-is_main();
 
 # we want to operate in a cleanup handler
 if ($r-current_callback eq 'PerlCleanupHandler') {
-return $class-_exit_if_too_big($r);
+return __PACKAGE__-_exit_if_too_big($r);
 }
 else {
-$class-add_cleanup_handler($r);
+__PACKAGE__-add_cleanup_handler($r);
 }
 
 return Apache::Constants::DECLINED();

Modified: perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm
URL: 
http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm?rev=1002458r1=1002457r2=1002458view=diff
==
--- perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm (original)
+++ perl/Apache-SizeLimit/trunk/lib/Apache/SizeLimit/Core.pm Wed Sep 29 
03:50:07 2010
@@ -16,6 +16,7 @@
 package Apache::SizeLimit::Core;
 
 use strict;
+use warnings;
 
 use Config;
 use Exporter;
@@ -48,7 +49,7 @@ use vars qw(
 $START_TIME
);
 
-$VERSION = '0.93-dev';
+$VERSION = '0.93-rc1';
 
 $REQUEST_COUNT  = 1;
 

Modified: perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm
URL: 
http://svn.apache.org/viewvc/perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm?rev=1002458r1=1002457r2=1002458view=diff
==
--- perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm (original)
+++ perl/Apache-SizeLimit/trunk/lib/Apache2/SizeLimit.pm Wed Sep 29 03:50:07 
2010
@@ -16,6 +16,8 @@
 package Apache2::SizeLimit;
 
 use strict;
+use warnings;
+
 use Config;
 
 use APR::Pool ();
@@ -32,7 +34,7 @@ die Apache2::SizeLimit at the moment wo
 use constant IS_WIN32 = $Config{'osname'} eq 'MSWin32' ? 1 : 0;
 
 # 2.x requires 5.6.x+ so 'our' is okay
-our $VERSION = '0.93-dev';
+our $VERSION = '0.93-rc1';
 
 use Apache::SizeLimit::Core qw(
  $MAX_PROCESS_SIZE
@@ -48,18 +50,17 @@ our @ISA = qw(Apache::SizeLimit::Core);
 
 __PACKAGE__-set_check_interval(1);
 
-sub handler ($$) {
-my $class = shift;
+sub handler {
 my $r = shift || Apache2::RequestUtil-request();
 
 return Apache2::Const::DECLINED unless $r-is_initial_req();
 
 # we want to operate in a cleanup handler
 if (ModPerl::Util::current_callback() eq 'PerlCleanupHandler') {
-return $class-_exit_if_too_big($r);
+return __PACKAGE__-_exit_if_too_big($r);
 }
 else {
-$class-add_cleanup_handler($r);
+__PACKAGE__-add_cleanup_handler($r);
 }
 
 return Apache2::Const::DECLINED;