From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: [PATCH 3/5] gitweb: Use nonlocal jump instead of 'exit' in die_error
Date: Sat, 24 Apr 2010 15:56:13 +0200 [thread overview]
Message-ID: <20100424135334.30511.26522.stgit@localhost.localdomain> (raw)
In-Reply-To: <20100424132255.30511.98829.stgit@localhost.localdomain>
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@gmail.com>
---
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;
}
## ----------------------------------------------------------------------
next prev parent reply other threads:[~2010-04-24 13:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-24 13:46 [PATCH 0/5] gitweb: Miscellaneous improvements, in preparation for caching support Jakub Narebski
2010-04-24 13:50 ` [PATCH 1/5] Export more test-related variables when running external tests Jakub Narebski
2010-04-25 11:47 ` Jakub Narebski
2010-04-24 13:53 ` [PATCH 2/5] gitweb: href(..., -path_info => 0|1) Jakub Narebski
2010-04-24 13:56 ` Jakub Narebski [this message]
2010-05-04 11:39 ` [PATCH 3/5] gitweb: Use nonlocal jump instead of 'exit' in die_error Jakub Narebski
2010-04-24 14:00 ` [PATCH 4/5] gitweb: Add custom error handler using die_error Jakub Narebski
2010-04-24 14:01 ` [PATCH 5/5] gitweb: Move generating page title to separate subroutine Jakub Narebski
2010-04-25 9:20 ` [PATCH 0/5] gitweb: Miscellaneous improvements, in preparation for caching support Petr Baudis
2010-04-25 11:45 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100424135334.30511.26522.stgit@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).