* [PATCH 1/4] nntp: use msg_more as a method
2019-07-05 22:53 5% [PATCH 0/4] implement NNTP COMPRESS per RFC 8054 Eric Wong
@ 2019-07-05 22:53 7% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-07-05 22:53 UTC (permalink / raw)
To: meta
It's a tad slower, but we'll be able to subclass this to rely
on zlib deflate buffering. This is advantageous for TLS clients
since (AFAIK) IO::Socket::SSL/OpenSSL doesn't give us ways to use
MSG_MORE or writev(2) like like GNUTLS does.
---
lib/PublicInbox/NNTP.pm | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/lib/PublicInbox/NNTP.pm b/lib/PublicInbox/NNTP.pm
index d106e315..9b8b81ec 100644
--- a/lib/PublicInbox/NNTP.pm
+++ b/lib/PublicInbox/NNTP.pm
@@ -14,7 +14,7 @@ use PublicInbox::Git;
require PublicInbox::EvCleanup;
use Email::Simple;
use POSIX qw(strftime);
-PublicInbox::DS->import(qw(now msg_more));
+PublicInbox::DS->import(qw(now));
use Digest::SHA qw(sha1_hex);
use Time::Local qw(timegm timelocal);
use constant {
@@ -158,12 +158,12 @@ sub cmd_xgtitle ($;$) {
sub list_overview_fmt ($) {
my ($self) = @_;
- msg_more($self, $OVERVIEW_FMT);
+ $self->msg_more($OVERVIEW_FMT);
}
sub list_headers ($;$) {
my ($self) = @_;
- msg_more($self, $LIST_HEADERS);
+ $self->msg_more($LIST_HEADERS);
}
sub list_active ($;$) {
@@ -517,7 +517,7 @@ sub msg_body_write ($$) {
$$msg =~ s/^\./../smg;
$$msg =~ s/(?<!\r)\n/\r\n/sg; # Alpine barfs without this
$$msg .= "\r\n" unless $$msg =~ /\r\n\z/s;
- msg_more($self, $$msg);
+ $self->msg_more($$msg);
'.'
}
@@ -538,7 +538,7 @@ sub msg_hdr_write ($$$) {
# affect messages already in the archive.
$hdr =~ s/^(Message-ID:)[ \t]*\r\n[ \t]+([^\r]+)\r\n/$1 $2\r\n/igsm;
$hdr .= "\r\n" if $body_follows;
- msg_more($self, $hdr);
+ $self->msg_more($hdr);
}
sub cmd_article ($;$) {
@@ -757,7 +757,7 @@ sub hdr_searchmsg ($$$$) {
$tmp .= $s->{num} . ' ' . $s->$field . "\r\n";
}
utf8::encode($tmp);
- msg_more($self, $tmp);
+ $self->msg_more($tmp);
$cur = $msgs->[-1]->{num} + 1;
});
}
@@ -924,7 +924,7 @@ sub cmd_xpath ($$) {
sub res ($$) { do_write($_[0], $_[1] . "\r\n") }
-sub more ($$) { msg_more($_[0], $_[1] . "\r\n") }
+sub more ($$) { $_[0]->msg_more($_[1] . "\r\n") }
sub do_write ($$) {
my $self = $_[0];
--
EW
^ permalink raw reply related [relevance 7%]
* [PATCH 0/4] implement NNTP COMPRESS per RFC 8054
@ 2019-07-05 22:53 5% Eric Wong
2019-07-05 22:53 7% ` [PATCH 1/4] nntp: use msg_more as a method Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-07-05 22:53 UTC (permalink / raw)
To: meta
First 3 patches are pretty straightforward, but 3/4
was disappointing... 4/4 alleviates the disappointment,
but it's kinda scary :>
Now, which newsreaders support COMPRESS?
I've tested my patches to Net::NNTP against news.gmane.org:
https://rt.cpan.org/Ticket/Display.html?id=129967
Eric Wong (4):
nntp: use msg_more as a method
nntp: move LINE_MAX constant to the top
nntp: support COMPRESS DEFLATE per RFC 8054
nntp: reduce server memory overhead of COMPRESS DEFLATE
MANIFEST | 2 +
TODO | 2 -
lib/PublicInbox/DS.pm | 4 +-
lib/PublicInbox/NNTP.pm | 46 +++++--
lib/PublicInbox/NNTPdeflate.pm | 119 ++++++++++++++++++
script/public-inbox-nntpd | 2 +-
t/nntpd-tls.t | 11 ++
t/nntpd-validate.t | 216 +++++++++++++++++++++++++++++++++
t/nntpd.t | 7 ++
9 files changed, 396 insertions(+), 13 deletions(-)
create mode 100644 lib/PublicInbox/NNTPdeflate.pm
create mode 100644 t/nntpd-validate.t
--
EW
^ permalink raw reply [relevance 5%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-07-05 22:53 5% [PATCH 0/4] implement NNTP COMPRESS per RFC 8054 Eric Wong
2019-07-05 22:53 7% ` [PATCH 1/4] nntp: use msg_more as a method 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).