user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/3] dsdeflate: shorten scope of initial buffer
  2022-07-23 15:52  6% [PATCH 0/3] nntpd + imapd deflate updates Eric Wong
@ 2022-07-23 15:52  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2022-07-23 15:52 UTC (permalink / raw)
  To: meta

There's no need to keep the initial buffer alive in package-wide
scope once it's replaced by `$next' in ->write or ->zflush.
---
 lib/PublicInbox/DSdeflate.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/PublicInbox/DSdeflate.pm b/lib/PublicInbox/DSdeflate.pm
index b5208e43..bf0ecd38 100644
--- a/lib/PublicInbox/DSdeflate.pm
+++ b/lib/PublicInbox/DSdeflate.pm
@@ -27,10 +27,10 @@ my %IN_OPT = (
 );
 
 # global deflate context and buffer
-my $zbuf = \(my $buf = '');
-my $zout;
+my ($zout, $zbuf);
 {
 	my $err;
+	$zbuf = \(my $initial = ''); # replaced by $next in zflush/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

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/3] nntpd + imapd deflate updates
@ 2022-07-23 15:52  6% Eric Wong
  2022-07-23 15:52  7% ` [PATCH 2/3] dsdeflate: shorten scope of initial buffer Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2022-07-23 15:52 UTC (permalink / raw)
  To: meta

Nothing earth shattering, some version of xt/mem-nntpd-tls.t has
been sitting somewhere in my ~ for ages

Eric Wong (3):
  xt/mem-imapd-tls: update aliases to DSdeflate subs
  dsdeflate: shorten scope of initial buffer
  add xt/mem-nntpd-tls maintainer test

 MANIFEST                     |   1 +
 lib/PublicInbox/DSdeflate.pm |   4 +-
 xt/mem-imapd-tls.t           |   4 +-
 xt/mem-nntpd-tls.t           | 254 +++++++++++++++++++++++++++++++++++
 4 files changed, 259 insertions(+), 4 deletions(-)
 create mode 100644 xt/mem-nntpd-tls.t

^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-07-23 15:52  6% [PATCH 0/3] nntpd + imapd deflate updates Eric Wong
2022-07-23 15:52  7% ` [PATCH 2/3] dsdeflate: shorten scope of initial buffer Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).