mirror of
https://github.com/git/git.git
synced 2024-12-18 06:14:59 +08:00
gitweb: Return or exit after done serving request
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>
This commit is contained in:
parent
a5080d8e10
commit
5ed2ec1041
@ -1000,8 +1000,16 @@ if ($action !~ m/^(?:opml|project_list|project_index)$/ &&
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user