]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/NNTP.pm
nntp: reduce memory overhead of zlib
[public-inbox.git] / lib / PublicInbox / NNTP.pm
index d6f315bab42a9ed7e0b8b607a3ba6cf01066ef55..895858b754cd44e0a95e99889075a444b54393ee 100644 (file)
@@ -642,6 +642,11 @@ sub long_response ($$) {
                } elsif ($more) { # $self->{wbuf}:
                        update_idle_time($self);
 
+                       # COMPRESS users all share the same DEFLATE context.
+                       # Flush it here to ensure clients don't see
+                       # each other's data
+                       $self->zflush;
+
                        # no recursion, schedule another call ASAP
                        # but only after all pending writes are done
                        my $wbuf = $self->{wbuf} ||= [];
@@ -925,6 +930,8 @@ sub cmd_compress ($$) {
        undef
 }
 
+sub zflush {} # overridden by NNTPdeflate
+
 sub cmd_xpath ($$) {
        my ($self, $mid) = @_;
        return r501 unless $mid =~ /\A<(.+)>\z/;