[Jifty-commit] jifty branch, plack-rebased, updated. e1ae908445e20a25e4e07bcd43445b296e0edc2d

Jifty commits jifty-commit at lists.jifty.org
Sat Feb 6 11:45:39 EST 2010


The branch, plack-rebased has been updated
       via  e1ae908445e20a25e4e07bcd43445b296e0edc2d (commit)
      from  e42d1c730fbd4ff5136ed5c00f96ff30602f5f64 (commit)

Summary of changes:
 lib/Jifty/Continuation.pm |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

- Log -----------------------------------------------------------------
commit e1ae908445e20a25e4e07bcd43445b296e0edc2d
Author: Chia-liang Kao <clkao at clkao.org>
Date:   Sun Feb 7 00:45:29 2010 +0800

    more potential fh to avoid during serialization

diff --git a/lib/Jifty/Continuation.pm b/lib/Jifty/Continuation.pm
index 5173245..b3441c6 100644
--- a/lib/Jifty/Continuation.pm
+++ b/lib/Jifty/Continuation.pm
@@ -131,9 +131,13 @@ sub new {
     my $key = Jifty->web->serial . "_" . int(rand(10)) . int(rand(10)) . int(rand(10)) . int(rand(10)) . int(rand(10)) . int(rand(10));
     $self->id($key);
 
+    # XXX: Jifty::Request should really just extract useful things
+    # from plack so we don't have plack-specified fields to hide here.
+
     # Make sure we don't store any of the connection information
     local $self->request->{env}{"psgi.input"};
     local $self->request->{env}{"psgi.errors"};
+    local $self->request->{env}{"plack.request.tempfh"};
     local $self->request->{_body_parser}{input_handle} if defined $self->request->{_body_parser};
 
     # Save it into the session
@@ -246,9 +250,16 @@ sub return {
     # Set the current request to the one in the continuation
     my $input  = Jifty->web->request->env->{"psgi.input"};
     my $errors = Jifty->web->request->env->{"psgi.errors"};
+    my $tempfh = Jifty->web->request->env->{"plack.request.tempfh"};
+    my $ihandle = Jifty->web->request->{_body_parser}
+        ? Jifty->web->request->{_body_parser}{input_handle} : undef;
+
     Jifty->web->request($self->request->clone);
+
     Jifty->web->request->env->{"psgi.input"}  = $input;
     Jifty->web->request->env->{"psgi.errors"} = $errors;
+    Jifty->web->request->env->{"plack.request.tempfh"} = $tempfh;
+    Jifty->web->request->{_body_parser}{input_handle} = $ihandle if $ihandle;
     return Jifty->web->request;
 }
 

-----------------------------------------------------------------------


More information about the Jifty-commit mailing list