From: Jakub Narebski Date: Sat, 24 Apr 2010 13:56:13 +0000 (+0200) Subject: gitweb: Use nonlocal jump instead of 'exit' in die_error X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/9942474cf9d36f1bf24a061720b9a27f68291e977ea43330a9e1e85f2b535126 gitweb: Use nonlocal jump instead of 'exit' in die_error Use 'goto DONE' in place of 'exit' to end request processing in die_error() subroutine. While at it, do not end gitweb with 'exit'. This would make it easier in the future to add support or improve support for persistent environments such as FastCGI and mod_perl. It would also make it easier to make use of die_error() as an error handler (for fatalsToBrowser). Perl 5 allows non-local jumps; the restriction is that you cannot jump into a scope. Signed-off-by: Jakub Narebski Acked-by: Petr Baudis Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 875e982..bebb1a3 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -973,7 +973,8 @@ if ($action !~ m/^(?:opml|project_list|project_index)$/ && die_error(400, "Project needed"); } $actions{$action}->(); -exit; +DONE_GITWEB: +1; ## ====================================================================== ## action links @@ -3433,7 +3434,7 @@ EOF print "\n"; git_footer_html(); - exit; + goto DONE_GITWEB; } ## ----------------------------------------------------------------------