[Catalyst-commits] r13156 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Tue Apr 13 22:06:19 GMT 2010
Author: t0m
Date: 2010-04-13 23:06:19 +0100 (Tue, 13 Apr 2010)
New Revision: 13156
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/Makefile.PL
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
Log:
Fix RT#41442 so that temporary files are always, always cleaned up.
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2010-04-13 21:03:58 UTC (rev 13155)
+++ Catalyst-Runtime/5.80/trunk/Changes 2010-04-13 22:06:19 UTC (rev 13156)
@@ -4,6 +4,9 @@
- Additional fix for getting the base application path right when rewriting
requests into an application sub path with mod_alias and mod_rewrite on
Apache.
+ - Ensure to always cleanup temporary uploaded files in all cases, even
+ when exceptions occur during request processing, using HTTP::Body's
+ ->cleanup feature. (RT#41442)
New features:
- Setting __PACKAGE__->config(enable_catalyst_header => 1); in your MyApp.pm
Modified: Catalyst-Runtime/5.80/trunk/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/trunk/Makefile.PL 2010-04-13 21:03:58 UTC (rev 13155)
+++ Catalyst-Runtime/5.80/trunk/Makefile.PL 2010-04-13 22:06:19 UTC (rev 13156)
@@ -27,7 +27,7 @@
requires 'CGI::Simple::Cookie' => '1.109';
requires 'Data::Dump';
requires 'HTML::Entities';
-requires 'HTTP::Body' => '1.04'; # makes uploadtmp work
+requires 'HTTP::Body' => '1.06'; # ->cleanup(1)
requires 'HTTP::Headers' => '1.64';
requires 'HTTP::Request' => '5.814';
requires 'HTTP::Response' => '5.813';
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2010-04-13 21:03:58 UTC (rev 13155)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2010-04-13 22:06:19 UTC (rev 13156)
@@ -311,6 +311,8 @@
sub finalize_uploads {
my ( $self, $c ) = @_;
+ # N.B. This code is theoretically entirely unneeded due to ->cleanup(1)
+ # on the HTTP::Body object.
my $request = $c->request;
foreach my $key (keys %{ $request->uploads }) {
my $upload = $request->uploads->{$key};
@@ -335,6 +337,7 @@
unless ( $request->_body ) {
my $type = $request->header('Content-Type');
$request->_body(HTTP::Body->new( $type, $length ));
+ $request->_body->cleanup(1); # Make extra sure!
$request->_body->tmpdir( $appclass->config->{uploadtmp} )
if exists $appclass->config->{uploadtmp};
}
More information about the Catalyst-commits
mailing list