[PATCH 3/5] gitweb: Use nonlocal jump instead of 'exit' in die_error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <jnareb@xxxxxxxxx>
---
This patch is most independent of introducing caching support to
gitweb, and I think it would be good to have nevertheless.

 gitweb/gitweb.perl |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 6cefb09..ed92dca 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -972,7 +972,8 @@ if ($action !~ m/^(?:opml|project_list|project_index)$/ &&
 	die_error(400, "Project needed");
 }
 $actions{$action}->();
-exit;
+DONE_GITWEB:
+1;
 
 ## ======================================================================
 ## action links
@@ -3432,7 +3433,7 @@ EOF
 	print "</div>\n";
 
 	git_footer_html();
-	exit;
+	goto DONE_GITWEB;
 }
 
 ## ----------------------------------------------------------------------

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]