🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #55799

Re: Forecasting the posting's size

#55799
From: Curt Welch
Date: Sun, 30 Dec 2001 21:17
33 lines
2394 bytes
"Joshua" <JoshuaIIII@hotmail.com> wrote:
> After the Server receiving POST command from the client,does he have any
> way to forecast the size of the article that the client will post?
>
> Usually,the server will dynamically requires memory for caching and
> processing the receiving posting.I can't find the grounds for the server
> to determine how much memory he has to apply for that?

That's because you can't know.  You simply have to allocate the memory
as you read, or you can write the data to a file as you read.

> Yes,most server has his own upper limit of posting. But at extreme
> situation,a client can posting a very,very large article(containing
> attachment). The server has to receive the whole posting until get the
> ending sign string(CRLF.CRLF) before he get a chance to respond the
> client a piece of message such as "441 Error.Guy,too big article!".

Yes, that's exactly what you have to do.   If it gets too large you still
have to keep reading it from the NNTP stream, but you simply stop storing
it.

Nobody said writing a server would be easy. :)

> Of
> course,he can directly closes the conversation as soon as the upper limit
> reaches,

That would be wrong.

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/
Technical Details
Message-ID: <20011230161737.549$XI@newsreader.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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.onemain.com!feed1.onemain.com!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
References: <a0mi6f$qqr$1@mail.cn99.com>

Show Full Headers
Complete Article Headers
Message-ID: <20011230161737.549$XI@newsreader.com>
Subject: Re: Forecasting the posting's size
Date: Sun, 30 Dec 2001 21:17:37 +0000
From: curt@kcwc.com (Curt Welch)
References: <a0mi6f$qqr$1@mail.cn99.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.mbox.zip!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.onemain.com!feed1.onemain.com!feed1.newsreader.com!news2.newsreader.com!ellis.newsreader.com!not-for-mail
Organization: NewsReader.Com
Newsgroups: news.software.nntp
X-Trace: NewsReader.Com B@E5L,eldY1ui6qN2_Px.xvhml6A,izedluLiFW9XdQ5l,A
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5
  %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-Url: http://CurtWelch.Com/
User-Agent: NewsReader.Com
Lines: 32