git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] gitweb: Return or exit after done serving request
Date: Sun, 13 Jun 2010 22:33:50 -0700	[thread overview]
Message-ID: <7v1vcach4x.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: 20100613100800.28221.77529.stgit@localhost.localdomain

Jakub Narebski <jnareb@gmail.com> writes:

> 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.

  reply	other threads:[~2010-06-14  5:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-13 10:09 [PATCH] gitweb: Return or exit after done serving request Jakub Narebski
2010-06-14  5:33 ` Junio C Hamano [this message]
2010-06-14  8:28   ` Jakub Narebski
2010-06-14 20:54     ` Junio C Hamano

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=7v1vcach4x.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@gmail.com \
    /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).