about summary refs log tree commit homepage
path: root/lib/PublicInbox/NNTP.pm
diff options
context:
space:
mode:
authorEric Wong <e@yhbt.net>2020-04-21 06:57:34 +0000
committerEric Wong <e@yhbt.net>2020-04-22 07:04:45 +0000
commita318e758129d616b3b801db82c4735c680a2fbe8 (patch)
treeba9af6a937ecf8f2a7dc339a25f1ad2a0c0ddc75 /lib/PublicInbox/NNTP.pm
parenta45aef4d6415553dd1f6744770b00ea9033f58d7 (diff)
downloadpublic-inbox-a318e758129d616b3b801db82c4735c680a2fbe8.tar.gz
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"]
Diffstat (limited to 'lib/PublicInbox/NNTP.pm')
-rw-r--r--lib/PublicInbox/NNTP.pm11
1 files changed, 2 insertions, 9 deletions
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;