🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #58015

Re: A better way to post binaries

#58015
From: Jeremy
Date: Tue, 09 Apr 2002 00:28
40 lines
2398 bytes
Juergen Helbing <archiver@i3w.com> wrote:

>> Well, if you're writing a module which simply takes a stream on input
>> and sends back an encoded stream, you have to wait until you have all
>> of the data before you write any output, because until you do, you
>> don't know the size.
> 
> Did you plan to encode very small fractions (100-1000 bytes)
> with every encoder call ?

My test code (available on my website) uses 1k buffers.  It discards
the input each time (just keeping count of the number of bytes to get
the filesize) but has to keep the entire encoded output in a buffer
until it's finished.

> The maximum size for a message ca be considered to be 1 Meg.
> Having two buffers with each 1 Meg might be acceptable.

Not exactly optimal, though. :)

>> You also have to have a way to get the filename into the module.
> 
> You need this also for the subject line.

That's an entirely different part of the code, though, nothing to do
with the encoding.

> It would be nice if you could explain your "API" in more detail.
> I always thought that an external API would encode the full data
> for one message.

The actual API my test code is written for is the one for the Perl
MIME-tools package, where you write a plug-in encoder which takes
the raw stream on input and sends the encoded stream to output.
Luckily, there is a way to grab higher-level objects and extract
information from them, but that's just ugly.

-- 
Jeremy  |  jeremy@exit109.com
Technical Details
Message-ID: <1018312097.403582@ok-corral.gunslinger.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!saloon!newsbastard
References: <1017777829.201228@ok-corral.gunslinger.net> <060420022326598175%planb@newsreaders.com> <1018166203.925720@ok-corral.gunslinger.net> <36389.842204@archiver.winews.net>

Show Full Headers
Complete Article Headers
Message-ID: <1018312097.403582@ok-corral.gunslinger.net>
Subject: Re: A better way to post binaries
Date: Tue, 09 Apr 2002 00:28:17 +0000
From: Jeremy <jeremy@exit109.com>
References: <1017777829.201228@ok-corral.gunslinger.net> <060420022326598175%planb@newsreaders.com> <1018166203.925720@ok-corral.gunslinger.net> <36389.842204@archiver.winews.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!archiver1.google.com!news1.google.com!sn-xit-02!supernews.com!saloon!newsbastard
Newsgroups: news.software.nntp
Organization: There Is No Organization
Lines: 39
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Newsreader: trn 4.0-test76 (Apr 2, 2001)
X-Meow: Meow