[BACK]Return to cvsweb.cgi CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / cvsweb

Diff for /cvsweb/cvsweb.cgi between version 4.12 and 4.13

version 4.12, 2019/11/10 14:55:42 version 4.13, 2019/11/11 12:40:12
Line 86  use vars qw (
Line 86  use vars qw (
   $allow_enscript @enscript_options %enscript_types    $allow_enscript @enscript_options %enscript_types
 );  );
   
   require Compress::Zlib;
 use Cwd                   qw(abs_path);  use Cwd                   qw(abs_path);
 use File::Path            qw(rmtree);  use File::Path            qw(rmtree);
 use File::Spec::Functions qw(canonpath catdir catfile curdir devnull rootdir  use File::Spec::Functions qw(canonpath catdir catfile curdir devnull rootdir
Line 102  use constant CVSWEBMARKUP => qr{^text/(x-cvsweb|vnd\.v
Line 103  use constant CVSWEBMARKUP => qr{^text/(x-cvsweb|vnd\.v
 use constant LOG_FILESEPR => qr/^={77}$/o;  use constant LOG_FILESEPR => qr/^={77}$/o;
 use constant LOG_REVSEPR  => qr/^-{28}$/o;  use constant LOG_REVSEPR  => qr/^-{28}$/o;
   
 use constant HAS_ZLIB     => eval { require Compress::Zlib; };  
 use constant HAS_EDIFF    => eval { require String::Ediff;  };  use constant HAS_EDIFF    => eval { require String::Ediff;  };
   
 # -----------------------------------------------------------------------------  # -----------------------------------------------------------------------------
Line 317  $maycompress = (
Line 317  $maycompress = (
     && $ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/)      && $ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/)
    || $is_mozilla3)     || $is_mozilla3)
   && !$is_msie    && !$is_msie
   && !(defined($ENV{MOD_PERL}) && !HAS_ZLIB)    && !(defined($ENV{MOD_PERL}))
 );  );
   
 # Parameters that will be sticky in all constructed links/query strings.  # Parameters that will be sticky in all constructed links/query strings.
Line 4247  sub http_header(;$$)
Line 4247  sub http_header(;$$)
     "img-src 'self'; style-src 'unsafe-inline'");      "img-src 'self'; style-src 'unsafe-inline'");
   
   if ($allow_compress && $maycompress) {    if ($allow_compress && $maycompress) {
     if (HAS_ZLIB  
         || (defined($CMD{gzip}) && open(GZIP, "| $CMD{gzip} -1 -c")))  
     {  
   
       push(@headers, 'Content-Encoding: gzip');        push(@headers, 'Content-Encoding: gzip');
       push(@headers, 'Vary: Accept-Encoding');     # RFC 2616, 14.44        push(@headers, 'Vary: Accept-Encoding');     # RFC 2616, 14.44
       print join("\r\n", @headers) . "\r\n\r\n";        print join("\r\n", @headers) . "\r\n\r\n";
Line 4258  sub http_header(;$$)
Line 4254  sub http_header(;$$)
       $| = 1;        $| = 1;
       $| = 0;                                      # Flush header output.        $| = 0;                                      # Flush header output.
   
       tie(*GZIP, __PACKAGE__, \*STDOUT) if HAS_ZLIB;        tie(*GZIP, __PACKAGE__, \*STDOUT);
       select(GZIP);        select(GZIP);
       $gzip_open = 1;        $gzip_open = 1;
   
     } else {  
   
       print join("\r\n", @headers) . "\r\n\r\n";  
       printf  
         '<span style="font-size: smaller">Unable to find gzip binary in the <b>$command_path</b> (<code>%s</code>) to compress output</span><br />',  
           htmlquote(join(':', @command_path));  
     }  
   
   } else {    } else {
     print join("\r\n", @headers) . "\r\n\r\n";      print join("\r\n", @headers) . "\r\n\r\n";
   }    }

Legend:
Removed from v.4.12  
changed lines
  Added in v.4.13

CVSweb