From a318e758129d616b3b801db82c4735c680a2fbe8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 21 Apr 2020 06:57:34 +0000 Subject: make zlib-related modules a hard dependency This allows us to simplify some of our existing code and make future changes easier. I doubt anybody goes through the trouble to have a Perl installation without zlib support. The zlib source code is even bundled with Perl since 5.9.3 for systems without existing zlib development headers and libraries. Of course, zlib is also a requirement of git, too; and we're not going to stop using git :) [squashed: "wwwaltid: use gzipfilter up front"] --- lib/PublicInbox/NNTP.pm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib/PublicInbox/NNTP.pm') diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm index c79f198b..e9c66cd1 100644 --- a/lib/PublicInbox/NNTP.pm +++ b/lib/PublicInbox/NNTP.pm @@ -38,8 +38,7 @@ NEWNEWS\r LIST ACTIVE ACTIVE.TIMES NEWSGROUPS OVERVIEW.FMT\r HDR\r OVER\r - -my $have_deflate; +COMPRESS DEFLATE\r sub greet ($) { $_[0]->write($_[0]->{nntpd}->{greet}) }; @@ -903,7 +902,7 @@ sub cmd_starttls ($) { sub cmd_compress ($$) { my ($self, $alg) = @_; return '503 Only DEFLATE is supported' if uc($alg) ne 'DEFLATE'; - return r502 if $self->compressed || !$have_deflate; + return r502 if $self->compressed; PublicInbox::NNTPdeflate->enable($self); $self->requeue; undef @@ -990,10 +989,4 @@ sub busy { ($self->{rbuf} || $self->{wbuf} || $self->not_idle_long($now)); } -# this is an import to prevent "perl -c" from complaining about fields -sub import { - $have_deflate = eval { require PublicInbox::NNTPdeflate } and - $CAPABILITIES .= "COMPRESS DEFLATE\r\n"; -} - 1; -- cgit v1.2.3-24-ge0c7