git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] gitweb: Return or exit after done serving request

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 14, 2010, 05:33 UTC
Message-ID
<7v1vcach4x.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20100613100800.28221.77529.stgit@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> writes:
Show 19 quoted lines
> diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
> index e108bbc..02f366d 100755
> --- a/gitweb/gitweb.perl
> +++ b/gitweb/gitweb.perl
> @@ -987,7 +987,16 @@ if ($action !~ m/^(?:opml|project_list|project_index)$/ &&
>  	die_error(400, "Project needed");
>  }
>  $actions{$action}->();
> +
>  DONE_GITWEB:
> +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;
> +}
>  1;
Is the last "1;" still needed if we did this?

I am guessing that this new codeblock will go inside "sub run" when merging with your c2394fe (gitweb: Put all per-connection code in run() subroutine, 2010-05-07) and Sam's a0446e7 (gitweb: Add support for FastCGI, using CGI::Fast, 2010-05-07). If I am mistaken, please advise.

Thanks.
Previous: Jakub NarebskiNext: Jakub Narebski
Message 2 of 4 in “gitweb: Return or exit after done serving request”
  1. gitweb: Return or exit after done serving requestJakub Narebski, Jun 13, 2010
  2. Junio C HamanoJun 14, 2010
  3. Jakub NarebskiJun 14, 2010
  4. Junio C HamanoJun 14, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.