X-Git-Url: https://git.ladys.computer/Gitweb/blobdiff_plain/0fa5db2fad6d3d78e8685b90da95f71bc54082572d54d2ea9441f316891f185c..40d22e6f4c32c41f1f8e60ae2166f6646dbd10c751940f9c2193831d3d3fbc28:/gitweb.perl diff --git a/gitweb.perl b/gitweb.perl index 19b5a44..e533708 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -1028,18 +1028,18 @@ sub dispatch { $actions{$action}->(); } -sub run_request { +sub reset_timer { our $t0 = [Time::HiRes::gettimeofday()] if defined $t0; + our $number_of_git_cmds = 0; +} + +sub run_request { + reset_timer(); evaluate_uri(); - evaluate_gitweb_config(); - evaluate_git_version(); check_loadavg(); - # $projectroot and $projects_list might be set in gitweb config file - $projects_list ||= $projectroot; - evaluate_query_params(); evaluate_path_info(); evaluate_and_validate_params(); @@ -1087,6 +1087,11 @@ sub evaluate_argv { sub run { evaluate_argv(); + evaluate_gitweb_config(); + evaluate_git_version(); + + # $projectroot and $projects_list might be set in gitweb config file + $projects_list ||= $projectroot; $pre_listen_hook->() if $pre_listen_hook; @@ -1110,6 +1115,15 @@ sub run { run(); +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 @@ -3395,7 +3409,7 @@ sub git_header_html { } print $cgi->header(-type=>$content_type, -charset => 'utf-8', -status=> $status, -expires => $expires) - unless ($opts{'-no_http_headers'}); + unless ($opts{'-no_http_header'}); my $mod_perl_version = $ENV{'MOD_PERL'} ? " $ENV{'MOD_PERL'}" : ''; print <