From 7ab993d0c4488dde04eca2d6bf8a4c1eab19edc3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 Mar 2009 13:34:18 +0000 Subject: [PATCH] * Catalyst::Engine::HTTP::Prefork: terminate chunked transfers correctly. svn path=/nixpkgs/trunk/; revision=14504 --- .../catalyst-fix-chunked-encoding.patch | 23 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 5 ++++ 2 files changed, 28 insertions(+) create mode 100644 pkgs/development/perl-modules/catalyst-fix-chunked-encoding.patch diff --git a/pkgs/development/perl-modules/catalyst-fix-chunked-encoding.patch b/pkgs/development/perl-modules/catalyst-fix-chunked-encoding.patch new file mode 100644 index 00000000000..7822128f846 --- /dev/null +++ b/pkgs/development/perl-modules/catalyst-fix-chunked-encoding.patch @@ -0,0 +1,23 @@ +diff -rc Catalyst-Engine-HTTP-Prefork-0.50-orig/lib/Catalyst/Engine/HTTP/Prefork/Handler.pm Catalyst-Engine-HTTP-Prefork-0.50/lib/Catalyst/Engine/HTTP/Prefork/Handler.pm +*** Catalyst-Engine-HTTP-Prefork-0.50-orig/lib/Catalyst/Engine/HTTP/Prefork/Handler.pm 2008-03-14 18:23:47.000000000 +0100 +--- Catalyst-Engine-HTTP-Prefork-0.50/lib/Catalyst/Engine/HTTP/Prefork/Handler.pm 2009-03-11 14:18:40.000000000 +0100 +*************** +*** 199,206 **** + + if ( $self->{_chunked_res} ) { + if ( !$self->{_chunked_done} ) { +! # Write the final '0' chunk +! syswrite STDOUT, "0$CRLF"; + } + + delete $self->{_chunked_res}; +--- 199,207 ---- + + if ( $self->{_chunked_res} ) { + if ( !$self->{_chunked_done} ) { +! # Write the final '0' chunk and the CRLF that terminates +! # the chunked body. +! syswrite STDOUT, "0$CRLF$CRLF"; + } + + delete $self->{_chunked_res}; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e7c7ac9d04b..1d7200a525b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4354,6 +4354,11 @@ let perlCookieXS perlHTTPHeaderParserXS ]; buildInputs = [perlTestPod perlTestPodCoverage]; + patches = [ + # Fix chunked transfers (they were missing the final CR/LF at + # the end, which makes curl barf). + ../development/perl-modules/catalyst-fix-chunked-encoding.patch + ]; }; perlCatalystManual = buildPerlPackage rec {