From: schwarze@mandoc.bsd.lv
To: source@mandoc.bsd.lv
Subject: cvsweb: Compress::Zlib(3p) is provided by base Perl, so just use it
Date: Mon, 11 Nov 2019 07:40:43 -0500 (EST) [thread overview]
Message-ID: <8d07722fda85945c@mandoc.bsd.lv> (raw)
Log Message:
-----------
Compress::Zlib(3p) is provided by base Perl, so just use it unconditionally
Modified Files:
--------------
cvsweb:
cvsweb.cgi
Revision Data
-------------
Index: cvsweb.cgi
===================================================================
RCS file: /home/cvs/mandoc/cvsweb/cvsweb.cgi,v
retrieving revision 4.12
retrieving revision 4.13
diff -Lcvsweb.cgi -Lcvsweb.cgi -u -p -r4.12 -r4.13
--- cvsweb.cgi
+++ cvsweb.cgi
@@ -86,6 +86,7 @@ use vars qw (
$allow_enscript @enscript_options %enscript_types
);
+require Compress::Zlib;
use Cwd qw(abs_path);
use File::Path qw(rmtree);
use File::Spec::Functions qw(canonpath catdir catfile curdir devnull rootdir
@@ -102,7 +103,6 @@ use constant CVSWEBMARKUP => qr{^text/(x
use constant LOG_FILESEPR => qr/^={77}$/o;
use constant LOG_REVSEPR => qr/^-{28}$/o;
-use constant HAS_ZLIB => eval { require Compress::Zlib; };
use constant HAS_EDIFF => eval { require String::Ediff; };
# -----------------------------------------------------------------------------
@@ -317,7 +317,7 @@ $maycompress = (
&& $ENV{HTTP_ACCEPT_ENCODING} =~ /gzip/)
|| $is_mozilla3)
&& !$is_msie
- && !(defined($ENV{MOD_PERL}) && !HAS_ZLIB)
+ && !(defined($ENV{MOD_PERL}))
);
# Parameters that will be sticky in all constructed links/query strings.
@@ -4247,10 +4247,6 @@ sub http_header(;$$)
"img-src 'self'; style-src 'unsafe-inline'");
if ($allow_compress && $maycompress) {
- if (HAS_ZLIB
- || (defined($CMD{gzip}) && open(GZIP, "| $CMD{gzip} -1 -c")))
- {
-
push(@headers, 'Content-Encoding: gzip');
push(@headers, 'Vary: Accept-Encoding'); # RFC 2616, 14.44
print join("\r\n", @headers) . "\r\n\r\n";
@@ -4258,18 +4254,9 @@ sub http_header(;$$)
$| = 1;
$| = 0; # Flush header output.
- tie(*GZIP, __PACKAGE__, \*STDOUT) if HAS_ZLIB;
+ tie(*GZIP, __PACKAGE__, \*STDOUT);
select(GZIP);
$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 {
print join("\r\n", @headers) . "\r\n\r\n";
}
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
reply other threads:[~2019-11-11 12:40 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=8d07722fda85945c@mandoc.bsd.lv \
--to=schwarze@mandoc.bsd.lv \
--cc=source@mandoc.bsd.lv \
/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).