reassign 680816 libcatalyst-perl
tags 680816 - wontfix
tags 680816 patch
thanks

Hi,

 It's libcatalyst-perl bug, not for libcatalyst-plugin-unicode-encoding-perl.
 And upstream indicated there's a fix, so I've introduced it as a patch.
 Test build with pbuilder is fine :)

 Update to upstream new version 5.90016 needs new dependency to libsafe-isa-perl
 and libplack-perl (>= 0.9991), it also needs libplack-perl new upstream. 
 So, just apply this patch is good, I think.


-- 
Regards,

 Hideki Yamane     henrich @ debian.or.jp/org
 http://wiki.debian.org/HidekiYamane
diff -Nru libcatalyst-perl-5.90014/debian/changelog libcatalyst-perl-5.90014/debian/changelog
--- libcatalyst-perl-5.90014/debian/changelog	2012-06-28 07:59:24.000000000 +0900
+++ libcatalyst-perl-5.90014/debian/changelog	2012-09-20 00:23:24.000000000 +0900
@@ -1,3 +1,12 @@
+libcatalyst-perl (5.90014-1.1) UNRELEASED; urgency=low
+
+  * Non-maintainer upload.
+  * debian/patches
+    - add upstream fix as Fix->finalize_headers-getting-called-twice.patch
+    (Closes: #680816)
+
+ -- Hideki Yamane <henr...@debian.org>  Thu, 20 Sep 2012 00:22:00 +0900
+
 libcatalyst-perl (5.90014-1) unstable; urgency=low
 
   * Team upload.
diff -Nru libcatalyst-perl-5.90014/debian/patches/Fix->finalize_headers-getting-called-twice.patch libcatalyst-perl-5.90014/debian/patches/Fix->finalize_headers-getting-called-twice.patch
--- libcatalyst-perl-5.90014/debian/patches/Fix->finalize_headers-getting-called-twice.patch	1970-01-01 09:00:00.000000000 +0900
+++ libcatalyst-perl-5.90014/debian/patches/Fix->finalize_headers-getting-called-twice.patch	2012-09-20 00:21:57.000000000 +0900
@@ -0,0 +1,108 @@
+Description: Fix ->finalize_headers getting called twice
+Author: Tomas Doran <bobtf...@bobtfish.net>
+
+---
+Origin: upstream http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits/Catalyst-Runtime.git;a=commitdiff;h=89ba65d5fb85ab30fa5d8109cd0d22860608605b
+Bug: https://rt.cpan.org/Public/Bug/Display.html?id=78090
+Last-Update: 2012-07-12
+
+--- libcatalyst-perl-5.90014.orig/Changes
++++ libcatalyst-perl-5.90014/Changes
+@@ -1,5 +1,7 @@
+ # This file documents the revision history for Perl extension Catalyst.
+ 
++  - Fix $c->finalize_headers getting called twice. RT#78090
++
+ 5.90014 - 2012-06-26 10:00:00
+ 
+   - Fix calling finalize_headers before writing body when using $c->write /
+--- libcatalyst-perl-5.90014.orig/lib/Catalyst.pm
++++ libcatalyst-perl-5.90014/lib/Catalyst.pm
+@@ -1788,7 +1788,7 @@ sub finalize {
+             $c->finalize_error;
+         }
+ 
+-        $c->finalize_headers;
++        $c->finalize_headers unless $c->response->finalized_headers;
+ 
+         # HEAD request
+         if ( $c->request->method eq 'HEAD' ) {
+@@ -1898,7 +1898,7 @@ EOF
+ 
+     $c->finalize_cookies;
+ 
+-    $c->engine->finalize_headers( $c, @_ );
++    $c->response->finalize_headers();
+ 
+     # Done
+     $response->finalized_headers(1);
+--- libcatalyst-perl-5.90014.orig/lib/Catalyst/Engine.pm
++++ libcatalyst-perl-5.90014/lib/Catalyst/Engine.pm
+@@ -331,7 +331,7 @@ Allows engines to write headers to respo
+ sub finalize_headers {
+     my ($self, $ctx) = @_;
+ 
+-    $ctx->response->finalize_headers;
++    $ctx->finalize_headers unless $ctx->response->finalized_headers;
+     return;
+ }
+ 
+--- libcatalyst-perl-5.90014.orig/lib/Catalyst/Response.pm
++++ libcatalyst-perl-5.90014/lib/Catalyst/Response.pm
+@@ -57,7 +57,7 @@ sub write {
+     my ( $self, $buffer ) = @_;
+ 
+     # Finalize headers if someone manually writes output
+-    $self->_context->finalize_headers;
++    $self->_context->finalize_headers unless $self->finalized_headers;
+ 
+     $buffer = q[] unless defined $buffer;
+ 
+--- libcatalyst-perl-5.90014.orig/t/lib/TestApp.pm
++++ libcatalyst-perl-5.90014/t/lib/TestApp.pm
+@@ -131,6 +131,11 @@ sub finalize_headers {
+ 
+     $c->res->header('X-Test-Header', 'valid');
+ 
++    my $call_count = $c->stash->{finalize_headers_call_count} || 0;
++    $call_count++;
++    $c->stash(finalize_headers_call_count => $call_count);
++    $c->res->header('X-Test-Header-Call-Count' => $call_count);
++
+     return $c->maybe::next::method(@_);
+ }
+ 
+--- libcatalyst-perl-5.90014.orig/t/aggregate/live_component_controller_action_streaming.t
++++ libcatalyst-perl-5.90014/t/aggregate/live_component_controller_action_streaming.t
+@@ -30,6 +30,7 @@ sub run_tests {
+         ok( $response->is_success, 'Response Successful 2xx' );
+         is( $response->content_type, 'text/plain', 'Response Content-Type' );
+         is( $response->header('X-Test-Header'), 'valid', 'Headers sent properly' );
++        is( $response->header('X-Test-Header-Call-Count'), 1);
+ 
+         SKIP:
+         {
+@@ -69,6 +70,7 @@ EOF
+         is( $response->content_type, 'text/plain', 'Response Content-Type' );
+         is( $response->content_length, -s $file, 'Response Content-Length' );
+         is( $response->header('X-Test-Header'), 'valid', 'Headers sent properly' );
++        is( $response->header('X-Test-Header-Call-Count'), 1);
+         is( $response->content, $buffer, 'Content is read from filehandle' );
+ 
+         ok( $response = request('http://localhost/action/streaming/body_glob'),
+@@ -77,6 +79,7 @@ EOF
+         is( $response->content_type, 'text/plain', 'Response Content-Type' );
+         is( $response->content_length, -s $file, 'Response Content-Length' );
+         is( $response->header('X-Test-Header'), 'valid', 'Headers sent properly' );
++        is( $response->header('X-Test-Header-Call-Count'), 1);
+         is( $response->content, $buffer, 'Content is read from filehandle' );
+     }
+ 
+@@ -87,6 +90,7 @@ EOF
+         ok( $response->is_success, 'Response Successful 2xx' );
+         is( $response->content_type, 'text/plain', 'Response Content-Type' );
+         is( $response->header('X-Test-Header'), 'valid', 'Headers sent properly' );
++        is( $response->header('X-Test-Header-Call-Count'), 1);
+         is( $response->content_length, $size, 'Response Content-Length' );
+         is( $response->content, "\0" x $size, 'Content is read from filehandle' );
+     }
diff -Nru libcatalyst-perl-5.90014/debian/patches/series libcatalyst-perl-5.90014/debian/patches/series
--- libcatalyst-perl-5.90014/debian/patches/series	1970-01-01 09:00:00.000000000 +0900
+++ libcatalyst-perl-5.90014/debian/patches/series	2012-09-20 00:22:45.000000000 +0900
@@ -0,0 +1 @@
+Fix->finalize_headers-getting-called-twice.patch

Reply via email to