πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #87072

Re: About compression with NNTP

#87072
From: Russ Allbery
Date: Wed, 14 Oct 2015 20:49
45 lines
3299 bytes
Julien Γ‰LIE <iulius@nom-de-mon-site.com.invalid> writes:

> I received a private comment highlighting the fact that the COMPRESS
> command, as described in that draft, is not necessarily straight-forward
> to implement in all existing software.  The reason is that the mandatory
> use of deflate() from zlib implies that NNTP software can cope with
> 0-bytes in the stream.  Which is not always the case.

But that's also true of STARTTLS.

I think there may be some confusion here.  The point of COMPRESS as an
NNTP extension is to act as a transport layer, similar to STARTTLS or a
SASL confidentiality layer.  This makes it much easier to implement in the
same way that SSL support is easier to implement: you need only worry
about compression and decompression in your network code, when putting
bits on the wire or taking them off.  No command implementation has to
care, since by the time the bits have exited the transport layer,
everything is the plain-text protocol that the rest of the software is
expecting.

The approach that you describe, with compression implemented separately in
each command, is therefore quite a bit more complex.  Rather than having a
simple on-off at the network level such as with STARTTLS, each command now
has to be aware of the compression status and separately compress its own
data (but not the rest of the stream).

Nul octets are also a bit of a red herring for the same reason.  The whole
point of transport layers is that the rest of the software is unaffected
and won't see any nul octets.  Implementing COMPRESS is no harder than
implementing STARTTLS, which also introduces nul octets in the wire
representation, but not in the protocol as seen by the rest of the
implementation.

It should therefore be no harder to implement COMPRESS in an
implementation that can't handle nul octets than in one that can.  In both
cases, COMPRESS happens in the low-level guts of the network code, and the
rest of the software should be able to ignore its presence.

-- 
Russ Allbery (eagle@eyrie.org)              <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.

Technical Details
Message-ID: <87si5d41ll.fsf@hope.eyrie.org>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
References: <mvjp3s$n0u$1@news.trigofacile.com> <AABWHiG/QCkAACAT.A1.flnews@WStation2.stz-e.de> <mvmahl$iou$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <87si5d41ll.fsf@hope.eyrie.org>
Subject: Re: About compression with NNTP
Date: Wed, 14 Oct 2015 13:49:42 -0700
From: Russ Allbery <eagle@eyrie.org>
References: <mvjp3s$n0u$1@news.trigofacile.com> <AABWHiG/QCkAACAT.A1.flnews@WStation2.stz-e.de> <mvmahl$iou$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.(19219).mbox.7z!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 43
NNTP-Posting-Host: 96.90.234.101
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Trace: usenet-its.stanford.edu 1444855782 14003 96.90.234.101 (14 Oct 2015 20:49:42 GMT)
X-Complaints-To: news@usenet-its.stanford.edu
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)
Cancel-Lock: sha1:bLsm4EYf7nt3yMxWqi2gAT6EqHc=
X-Received-Body-CRC: 2928928593
X-Received-Bytes: 3213