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

Re: [PATCH/RFC v2] gitweb: Run in FastCGI mode if gitweb script has .fcgi extension

From
Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Date
Jun 6, 2010, 20:18 UTC
Message-ID
<AANLkTimApmqQmbsIkfKmgXAMTaoQqDV5fU3S7SwXoScY@mail.gmail.com>
In-Reply-To
<201006062209.53176.jnareb@gmail.com>
Show 12 quoted lines
> @@ -1056,19 +1056,24 @@ our $is_last_request = sub { 1 };
>  our ($pre_dispatch_hook, $post_dispatch_hook, $pre_listen_hook);
>  our $CGI = 'CGI';
>  our $cgi;
> +sub configure_as_fcgi {
> +       require CGI::Fast;
> +       our $CGI = 'CGI::Fast';
> +
> +       my $request_number = 0;
> +       # let each child service 100 requests
> +       our $is_last_request = sub { ++$request_number > 100 };
> +}
You missed to put a new line in here.
Show 23 quoted lines
>  sub evaluate_argv {
> +       my $script_name = $ENV{'SCRIPT_NAME'} || $ENV{'SCRIPT_FILENAME'} || __FILE__;
> +       configure_as_fcgi()
> +               if $script_name =~ /\.fcgi$/;
> +
>        return unless (@ARGV);
>
>        require Getopt::Long;
>        Getopt::Long::GetOptions(
> -               'fastcgi|fcgi|f' => sub {
> -                       require CGI::Fast;
> -                       our $CGI = 'CGI::Fast';
> -
> -                       my $request_number = 0;
> -                       # let each child service 100 requests
> -                       our $is_last_request = sub { ++$request_number > 100 };
> -               },
> +               'fastcgi|fcgi|f' => \&configure_as_fcgi,
>                'nproc|n=i' => sub {
>                        my ($arg, $val) = @_;
>                        return unless eval { require FCGI::ProcManager; 1; };
> --
> 1.7.0.1

Thanks, Pavan.

Previous: Jakub Narebski
Message 4 of 4 in “gitweb: Run in FastCGI mode if gitweb script has .fcgi extension”
  1. gitweb: Run in FastCGI mode if gitweb script has .fcgi extensionJakub Narebski, Jun 5, 2010
  2. Ævar Arnfjörð BjarmasonJun 5, 2010
  3. gitweb: Run in FastCGI mode if gitweb script has .fcgi extensionJakub Narebski, Jun 6, 2010
  4. Pavan Kumar SunkaraJun 6, 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.