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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

>  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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]