Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
gitweb: Return or exit after done serving request
author
Jakub Narebski
<jnareb@gmail.com>
Sun, 13 Jun 2010 10:09:32 +0000
(12:09 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 14 Jun 2010 17:55:38 +0000
(10:55 -0700)
Check if there is a caller in top frame of gitweb, and either 'return'
if gitweb code is wrapped in subroutine, or 'exit' if it is not.
This should avoid
gitweb.cgi: Subroutine git_SOMETHING redefined at gitweb.cgi line NNN
warnings in error_log when running gitweb with mod_perl (using
ModPerl::Registry handler)
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
gitweb/gitweb.perl
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
a5080d8
)
diff --git
a/gitweb/gitweb.perl
b/gitweb/gitweb.perl
index 2365311d94e78b894b42526c3181e45f23ce14ac..9d2b8c3b64fc50b96c7eb75c09520f3903d4845c 100755
(executable)
--- a/
gitweb/gitweb.perl
+++ b/
gitweb/gitweb.perl
@@
-1000,8
+1000,16
@@
sub handle_errors_html {
die_error(400, "Project needed");
}
$actions{$action}->();
+
DONE_GITWEB:
-1;
+if (defined caller) {
+ # wrapped in a subroutine processing requests,
+ # e.g. mod_perl with ModPerl::Registry, or PSGI with Plack::App::WrapCGI
+ return;
+} else {
+ # pure CGI script, serving single request
+ exit;
+}
## ======================================================================
## action links