[Jifty-commit] r5173 - in jifty/trunk: lib/Jifty

Jifty commits jifty-commit at lists.jifty.org
Thu Feb 28 15:58:00 EST 2008


Author: alexmv
Date: Thu Feb 28 15:57:58 2008
New Revision: 5173

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/META.yml
   jifty/trunk/lib/Jifty/Handler.pm
   jifty/trunk/lib/Jifty/Request.pm

Log:
 r28186 at zoq-fot-pik:  chmrr | 2008-02-28 15:56:13 -0500
  * Redirects during continuation return should catch dispatcher ABORTs


Modified: jifty/trunk/META.yml
==============================================================================
--- jifty/trunk/META.yml	(original)
+++ jifty/trunk/META.yml	Thu Feb 28 15:57:58 2008
@@ -33,6 +33,7 @@
   Devel::EvalContext: 0
   Devel::Events::Objects: 0.02
   Devel::Gladiator: 0
+  Devel::REPL: 0
   Devel::Size: 0
   Digest::HMAC_SHA1: 0
   GD: 0
@@ -68,6 +69,7 @@
   Class::Accessor: 0
   Class::Container: 0
   Class::Data::Inheritable: 0
+  Class::Inspector: 1.2
   Class::Trigger: 0.12
   Clone: 0.27
   Compress::Zlib: 0
@@ -107,7 +109,7 @@
   Hook::LexWrap: 0
   IPC::PubSub: 0.23
   IPC::Run3: 0
-  JSON::Syck: 0.15
+  JSON::Syck: 0.29
   Jifty::DBI: 0.49
   LWP::UserAgent: 0
   Locale::Maketext::Extract: 0.20

Modified: jifty/trunk/lib/Jifty/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/Handler.pm	Thu Feb 28 15:57:58 2008
@@ -242,8 +242,9 @@
         Jifty::I18N->get_language_handle;
 
         # Return from the continuation if need be
-        Jifty->web->request->return_from_continuation;
-        $self->dispatcher->handle_request();
+        unless (Jifty->web->request->return_from_continuation) {
+            $self->dispatcher->handle_request();
+        } 
 
         $self->call_trigger('before_cleanup', $args{cgi});
 

Modified: jifty/trunk/lib/Jifty/Request.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Request.pm	(original)
+++ jifty/trunk/lib/Jifty/Request.pm	Thu Feb 28 15:57:58 2008
@@ -596,14 +596,31 @@
 
 =head2 return_from_continuation
 
+Returns from the current continuation, if there is one.  If the
+request path doesn't match, we call the continuation again, which
+should redirect to the right place.  If we have to do this, we return
+true, which should be taken as a sign to not process the reqest
+further.
+
 =cut
 
 sub return_from_continuation {
     my $self = shift;
     return unless $self->continuation_type and $self->continuation_type eq "return" and $self->continuation;
-    return $self->continuation->call unless $self->continuation->return_path_matches;
+    unless ($self->continuation->return_path_matches) {
+        # This aborts via Jifty::Dispatcher::_abort -- but we're not
+        # in the dispatcher yet, so it would go uncaught.  Catch it
+        # here.
+        eval {
+            $self->continuation->call;
+        };
+        my $err = $@;
+        warn $err if $err and $err ne "ABORT";
+        return 1;
+    }
     $self->log->debug("Returning from continuation ".$self->continuation->id);
-    return $self->continuation->return;
+    $self->continuation->return;
+    return undef;
 }
 
 =head2 path


More information about the Jifty-commit mailing list