]> Sergey Matveev's repositories - public-inbox.git/commitdiff
ds: use ->dflush to distinguish from ->zflush
authorEric Wong <e@80x24.org>
Wed, 3 Aug 2022 07:59:11 +0000 (07:59 +0000)
committerEric Wong <e@80x24.org>
Wed, 3 Aug 2022 19:57:37 +0000 (19:57 +0000)
->zflush is already for GzipFilter in PublicInbox::WWW,
while we use DEFLATE for NNTP and IMAP.  This ought to
make the code easier-to-follow.

lib/PublicInbox/DS.pm
lib/PublicInbox/DSdeflate.pm
lib/PublicInbox/IMAP.pm
lib/PublicInbox/NNTP.pm

index ef483aacf2724a4bf73a50e64223c1b40374f3f2..77e2e5e9d4a4ed0b96ab02be1f246f4c0ad76048 100644 (file)
@@ -648,7 +648,7 @@ sub shutdn ($) {
     }
 }
 
-sub zflush {} # overridden by DSdeflate
+sub dflush {} # overridden by DSdeflate
 sub compressed {} # overridden by DSdeflate
 sub long_response_done {} # overridden by Net::NNTP
 
@@ -682,7 +682,7 @@ sub requeue_once {
        my ($self) = @_;
        # COMPRESS users all share the same DEFLATE context.
        # Flush it here to ensure clients don't see each other's data
-       $self->zflush;
+       $self->dflush;
 
        # no recursion, schedule another call ASAP,
        # but only after all pending writes are done.
index bf0ecd3877c79295ed99c90c0e2f750f730b6bfe..639690e27f61873cf29234487bac58315b2a51d1 100644 (file)
@@ -30,7 +30,7 @@ my %IN_OPT = (
 my ($zout, $zbuf);
 {
        my $err;
-       $zbuf = \(my $initial = ''); # replaced by $next in zflush/write
+       $zbuf = \(my $initial = ''); # replaced by $next in dflush/write
        ($zout, $err) = Compress::Raw::Zlib::Deflate->new(
                # nnrpd (INN) and Compress::Raw::Zlib favor MemLevel=9,
                # the zlib C library and git use MemLevel=8 as the default
@@ -100,7 +100,7 @@ sub msg_more ($$) {
        1;
 }
 
-sub zflush ($) {
+sub dflush ($) {
        my ($self) = @_;
 
        my $deflated = $zbuf;
index 805f1102536d99d9cf77807f86e1b0b3e6290ce4..0f0f9b3aaa6722c021132ca96224051d75b8ccc4 100644 (file)
@@ -595,7 +595,7 @@ sub fetch_blob_cb { # called by git->cat_async via ibx_async_cat
                                        \&fetch_blob_cb, $fetch_arg);
        }
        fetch_run_ops($self, $smsg, $bref, $ops, $partial);
-       $pre ? $self->zflush : $self->requeue_once;
+       $pre ? $self->dflush : $self->requeue_once;
 }
 
 sub emit_rfc822 {
index b223eb07d417bad27115bcf5411090f4e9ab257c..791fe2a94e5b1d253a37176f8f8ccfc3f4bd2346 100644 (file)
@@ -556,7 +556,7 @@ sub blob_cb { # called by git->cat_async via ibx_async_cat
                $self->close;
                die "BUG: bad code: $r";
        }
-       $self->write(\".\r\n"); # flushes (includes ->zflush)
+       $self->write(\".\r\n"); # flushes (includes ->dflush)
        $self->requeue;
 }