[news.software.nntp] Sending batches via NNTP.

sjg@melb.bull.oz.au (Simon J. Gerraty) (02/05/91)

There was some discussion a little while back about the merits
or otherwise of sending compressed batches via TCP.
Most of those arguing against compressed batches appeared to be
in the situation of having fast, reliable network connections.

My site is fed from the US using NNTP over an X.25 link which
often gets as little as 200 bytes/sec, never more than 400 b/s
and sometimes less than 100 b/s. With news backing up on the feed
system and plenty of CPU available at both ends of this link, we
saw a definite benefit to us in sending compressed batches.  I
am posting, because I suspect others may be in the same
situation.

I elected to modify NNTP-1.5.10 rather than build a new daemon.
This had the advantage of speed - the changes for the new
command took less than a day to implement - as well as retaining
all the security features built into NNTP.

All I did was add a new command 

/* NAME:
 *	xbatch - accept complete batches
 *
 * SYNOPSIS:
 *      xbatch size
 *
 * DESCRIPTION:
 *      This function receives complete batches from the client 
 *      and injects them into the Cnews input queue.
 *
 *      The possible? client/server conversations look like:
 *      C: XBATCH nbytes
 *      S: 339 Ok
 *      C: sends "nbytes" of data
 *      S: 239 Batch transfered successfully.
 *      
 *      The client has the option of sending another batch.
 *      
 *      C: XBATCH nbytes
 *      S: 339 Ok
 *      C: sends "nbytes" of data
 *      S: 436 xbatch failed: [extra data]
 *      
 *      The client can try to re-send the current batch.
 *      The following can happen any time, and may well occur 
 *      after a failed transfer.
 *      
 *      C: XBATCH nbytes
 *      S: 400 xbatch failed: [extra data], goodbye.
 *
 *      The client should call back later.
 *      
 *      C: XBATCH nbytes
 *      S: 449 Sorry, you are not allowed to transfer batches.
 *      
 *      The client should not bother trying again.
 * 
 * RETURN VALUE:
 *      None
 */

I modified enqueue() so that when receiving batches it does not
exec newsrun as this is too inefficient.

My feed site is doing the client side and this too should not
take long - as soon as work commitments permit.  The daemon
changes have been tested and appear to work fine.

I would be interested to hear if others are interested in this
feature or have implemented something similar.  If there is
sufficient interest in the idea I'd be happy to post my NNTP
patches or otherwise make them available.



-- 
Simon J. Gerraty			<sjg@sun0.melb.bull.oz.au>

#include <disclaimer>             /* imagine something *very* witty here */