about summary refs log tree commit homepage
path: root/t/nntpd-tls.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-07-05 22:53:38 +0000
committerEric Wong <e@80x24.org>2019-07-06 04:33:37 +0000
commit77c66b4cdb1d52321ed3cb6352fe0b72312cbb71 (patch)
tree66e6b3a1a0a754abaa02589301b2b99a1af5ea41 /t/nntpd-tls.t
parentf60b310cf3ebabbb7aae6a74fb91bf5946983503 (diff)
downloadpublic-inbox-77c66b4cdb1d52321ed3cb6352fe0b72312cbb71.tar.gz
This is only tested so far with my patches to Net::NNTP at:
https://rt.cpan.org/Ticket/Display.html?id=129967

Memory use in C10K situations is disappointing, but that's
the nature of compression.

gzip compression over HTTPS does have the advantage of not
keeping zlib streams open when clients are idle, at the
cost of worse compression.
Diffstat (limited to 't/nntpd-tls.t')
-rw-r--r--t/nntpd-tls.t11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/nntpd-tls.t b/t/nntpd-tls.t
index 49b31221..84d6e3c0 100644
--- a/t/nntpd-tls.t
+++ b/t/nntpd-tls.t
@@ -29,6 +29,9 @@ require './t/common.perl';
 require PublicInbox::InboxWritable;
 require PublicInbox::MIME;
 require PublicInbox::SearchIdx;
+my $need_zlib;
+eval { require Compress::Raw::Zlib } or
+        $need_zlib = 'Compress::Raw::Zlib missing';
 my $version = 2; # v2 needs newer git
 require_git('2.6') if $version >= 2;
 my $tmpdir = tempdir('pi-nntpd-tls-XXXXXX', TMPDIR => 1, CLEANUP => 1);
@@ -234,6 +237,14 @@ sub get_capa {
                 die "unexpected: $!" unless defined($r);
                 die 'unexpected EOF' if $r == 0;
         } until $capa =~ /\.\r\n\z/;
+
+        my $deflate_capa = qr/\r\nCOMPRESS DEFLATE\r\n/;
+        if ($need_zlib) {
+                unlike($capa, $deflate_capa,
+                        'COMPRESS DEFLATE NOT advertised '.$need_zlib);
+        } else {
+                like($capa, $deflate_capa, 'COMPRESS DEFLATE advertised');
+        }
         $capa;
 }