]> Lady’s Gitweb - Gitweb/commitdiff
gitweb: Use nonlocal jump instead of 'exit' in die_error
authorJakub Narebski <redacted>
Sat, 24 Apr 2010 13:56:13 +0000 (15:56 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:39 +0000 (00:50 -0400)
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 <redacted>
Acked-by: Petr Baudis <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl

index 875e98272f8b2126a05f063c778b7dd1bc5a9d172cd47cf316137812562c440d..bebb1a33fb2e5b8fabdec5549e1107c4810037b3c3a2d008cfb173466b6c1046 100755 (executable)
@@ -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 "</div>\n";
 
        git_footer_html();
-       exit;
+       goto DONE_GITWEB;
 }
 
 ## ----------------------------------------------------------------------
This page took 0.315991 seconds and 4 git commands to generate.