Skip to content

Commit

Permalink
fixed automatic rendering to work after non-blocking operations have …
Browse files Browse the repository at this point in the history
…been performed in bridges
  • Loading branch information
kraih committed Aug 31, 2013
1 parent 8c26f2c commit d04f636
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 3 additions & 1 deletion Changes
@@ -1,5 +1,7 @@

4.29 2013-08-30
4.29 2013-08-31
- Fixed automatic rendering to work after non-blocking operations have been
performed in bridges.

4.28 2013-08-29
- Added support for non-blocking operations in bridges to
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Controller.pm
Expand Up @@ -520,7 +520,7 @@ implements the following new ones.
=head2 continue
my $success = $c->continue;
$c->continue;
Continue dispatch chain.
Expand Down
9 changes: 4 additions & 5 deletions lib/Mojolicious/Routes.pm
Expand Up @@ -30,20 +30,19 @@ sub continue {
my $match = $c->match;
my $stack = $match->stack;
my $current = $match->current;
return 1 unless my $field = $stack->[$current];
my $last = !$stack->[++$current];
return $self->auto_render($c) unless my $field = $stack->[$current];

# Merge captures into stash
my @keys = keys %$field;
my $stash = $c->stash;
@{$stash}{@keys} = @{$stash->{'mojo.captures'}}{@keys} = values %$field;

my $continue;
my $last = !$stack->[++$current];
if (my $cb = $field->{cb}) { $continue = $self->_callback($c, $cb, $last) }
else { $continue = $self->_controller($c, $field, $last) }
$match->current($current);

return $last || $continue ? $self->continue($c) : undef;
$self->continue($c) if $last || $continue;
}

sub dispatch {
Expand Down Expand Up @@ -82,7 +81,7 @@ sub dispatch {
}

return undef unless @{$c->match->stack};
$self->auto_render($c) if $self->continue($c);
$self->continue($c);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/group_lite_app.t
Expand Up @@ -36,7 +36,7 @@ under '/suspended' => sub {
return 0;
};

get '/' => sub { shift->render(inline => '<%= $suspended %>\\') };
get '/' => {inline => '<%= $suspended %>\\'};

under sub {
my $self = shift;
Expand Down

0 comments on commit d04f636

Please sign in to comment.