r69085 - in /branches/upstream/libplack-perl/current: ./ lib/ lib/Plack/ lib/Plack/Handler/ lib/Plack/Handler/Net/ lib/Plack/Middleware/ lib/Plack/Server/ t/Plack-Middleware/stacktrace/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Feb 19 14:11:01 UTC 2011


Author: jawnsy-guest
Date: Sat Feb 19 14:10:35 2011
New Revision: 69085

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=69085
Log:
[svn-upgrade] new version libplack-perl (0.9969)

Added:
    branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t
Removed:
    branches/upstream/libplack-perl/current/lib/Plack/Handler/Net/
Modified:
    branches/upstream/libplack-perl/current/Changes
    branches/upstream/libplack-perl/current/MANIFEST
    branches/upstream/libplack-perl/current/META.yml
    branches/upstream/libplack-perl/current/lib/Plack.pm
    branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm
    branches/upstream/libplack-perl/current/lib/Plack/Request.pm
    branches/upstream/libplack-perl/current/lib/Plack/Response.pm
    branches/upstream/libplack-perl/current/lib/Plack/Runner.pm
    branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm

Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Sat Feb 19 14:10:35 2011
@@ -1,6 +1,13 @@
 Revision history for Perl extension Plack
 
 Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release.
+
+0.9969  Fri Feb 18 21:35:29 PST 2011
+        - Suppress the use of unlocalized $_ in Plack::Runner (mst)
+        - Plack::Handler::Net::FastCGI is now removed from Plack core dist.
+          It will be released as a separate distribution on CPAN.
+        - Fixed Plack::Handler::Apache2 so that it can safely call log (Andy Wardley)
+        - StackTrace: Display graceful fallback errors when $SIG{__DIE__} is overridden in the application (mkanat)
 
 0.9968  Wed Feb  9 19:07:48 PST 2011
         - Fixed Recursive middleware to rethrow unknown exceptions. #166 (reported by waba)

Modified: branches/upstream/libplack-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/MANIFEST?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/MANIFEST (original)
+++ branches/upstream/libplack-perl/current/MANIFEST Sat Feb 19 14:10:35 2011
@@ -65,7 +65,6 @@
 lib/Plack/Handler/FCGI.pm
 lib/Plack/Handler/HTTP/Server/PSGI.pm
 lib/Plack/Handler/HTTP/Server/Simple.pm
-lib/Plack/Handler/Net/FastCGI.pm
 lib/Plack/Handler/Standalone.pm
 lib/Plack/HTTPParser.pm
 lib/Plack/HTTPParser/PP.pm
@@ -207,6 +206,7 @@
 t/Plack-Middleware/simple_logger.t
 t/Plack-Middleware/stacktrace/basic.t
 t/Plack-Middleware/stacktrace/force.t
+t/Plack-Middleware/stacktrace/sigdie.t
 t/Plack-Middleware/stacktrace/streaming.t
 t/Plack-Middleware/stacktrace/utf8.t
 t/Plack-Middleware/static.t

Modified: branches/upstream/libplack-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/META.yml?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Sat Feb 19 14:10:35 2011
@@ -40,4 +40,4 @@
   homepage: http://plackperl.org
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Plack.git
-version: 0.9968
+version: 0.9969

Modified: branches/upstream/libplack-perl/current/lib/Plack.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Sat Feb 19 14:10:35 2011
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9968';
+our $VERSION = '0.9969';
 $VERSION = eval $VERSION;
 
 1;

Modified: branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Handler/Apache2.pm Sat Feb 19 14:10:35 2011
@@ -6,6 +6,7 @@
 use Apache2::RequestUtil;
 use Apache2::Response;
 use Apache2::Const -compile => qw(OK);
+use Apache2::Log;
 use APR::Table;
 use IO::Handle;
 use Plack::Util;
@@ -106,7 +107,7 @@
     } else {
         # Apache's <Location> is matched but here is not.
         # This is something wrong. We can only respect original.
-        $r->log_error(
+        $r->server->log_error(
             "Your request path is '$path_info' and it doesn't match your Location(Match) '$location'. " .
             "This should be due to the configuration error. See perldoc Plack::Handler::Apache2 for details."
         );

Modified: branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/StackTrace.pm Sat Feb 19 14:10:35 2011
@@ -27,7 +27,12 @@
     };
 
     my $caught;
-    my $res = try { $self->app->($env) } catch { $caught = $_ };
+    my $res = try {
+        $self->app->($env);
+    } catch {
+        $caught = $_;
+        [ 500, [ "Content-Type", "text/plain; charset=utf-8" ], [ no_trace_error(utf8_safe($caught)) ] ];
+    };
 
     if ($trace && ($caught || ($self->force && ref $res eq 'ARRAY' && $res->[0] == 500)) ) {
         my $text = $trace->as_string;
@@ -48,6 +53,19 @@
     undef $trace;
 
     return $res;
+}
+
+sub no_trace_error {
+    my $msg = shift;
+    chomp($msg);
+
+    return <<EOF;
+The application raised the following error:
+
+  $msg
+
+and the StackTrace middleware couldn't catch its stack trace, possibly because your application overrides \$SIG{__DIE__} by itself, preventing the middleware from working correctly. Remove the offending code or module that does it: known examples are CGI::Carp and Carp::Always.
+EOF
 }
 
 sub munge_error {

Modified: branches/upstream/libplack-perl/current/lib/Plack/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Request.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Sat Feb 19 14:10:35 2011
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9968';
+our $VERSION = '0.9969';
 $VERSION = eval $VERSION;
 
 use HTTP::Headers;

Modified: branches/upstream/libplack-perl/current/lib/Plack/Response.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Response.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Sat Feb 19 14:10:35 2011
@@ -1,7 +1,7 @@
 package Plack::Response;
 use strict;
 use warnings;
-our $VERSION = '0.9968';
+our $VERSION = '0.9969';
 $VERSION = eval $VERSION;
 
 use Plack::Util::Accessor qw(body status);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Runner.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Runner.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Runner.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Runner.pm Sat Feb 19 14:10:35 2011
@@ -56,9 +56,9 @@
     );
 
     my(@options, @argv);
-    while (defined($_ = shift @ARGV)) {
-        if (s/^--?//) {
-            my @v = split '=', $_, 2;
+    while (defined(my $arg = shift @ARGV)) {
+        if ($arg =~ s/^--?//) {
+            my @v = split '=', $arg, 2;
             $v[0] =~ tr/-/_/;
             if (@v == 2) {
                 push @options, @v;
@@ -68,7 +68,7 @@
                 push @options, $v[0], shift @ARGV;
             }
         } else {
-            push @argv, $_;
+            push @argv, $arg;
         }
     }
 

Modified: branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm?rev=69085&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Sat Feb 19 14:10:35 2011
@@ -1,6 +1,6 @@
 package Plack::Server::ServerSimple;
 use strict;
-our $VERSION = '0.9968';
+our $VERSION = '0.9969';
 $VERSION = eval $VERSION;
 
 use parent qw(Plack::Handler::HTTP::Server::Simple);

Added: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t?rev=69085&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t (added)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t Sat Feb 19 14:10:35 2011
@@ -1,0 +1,28 @@
+use strict;
+use warnings;
+use Test::More;
+use Plack::Middleware::StackTrace;
+use Plack::Test;
+use HTTP::Request::Common;
+
+$Plack::Test::Impl = "Server";
+
+my $app = sub {
+    $SIG{__DIE__} = sub {};
+    die "meh";
+};
+
+my $wrapped = Plack::Middleware::StackTrace->wrap($app, no_print_errors => 1);
+
+test_psgi $wrapped, sub {
+    my $cb = shift;
+
+    my $req = GET "/";
+    my $res = $cb->($req);
+
+    is $res->code, 500;
+    like $res->content, qr/The application raised/;
+};
+
+done_testing;
+




More information about the Pkg-perl-cvs-commits mailing list