Article View: news.software.nntp
Article #56244Re: How recv() determines the receiving is finished?
From: Joshua
Date: Mon, 28 Jan 2002 02:39
Date: Mon, 28 Jan 2002 02:39
26 lines
2383 bytes
2383 bytes
Your help is very help.Thank you so much but... I didn't understand you very much here.Coz I have tried and I think "printf(received_buffer);" is working just well. I couldn't find what's wrong with this line of code.Could you point it out to me?Thank you! "Andrew Gierth" <andrew@erlenstar.demon.co.uk> wrote in message news:87665ntppq.fsf@erlenstar.demon.co.uk... > >>>>> "Joshua" == Joshua <JoshuaIIII@hotmail.com> writes: > For NNTP, the client knows whether it's expecting a single-line or a > multi-line response. It reads the first line (status line) and, if it's > a success response and a multi-line response is expected, then it reads > following lines until it gets a line consisting only of '.'+CRLF. This > is all explained in the RFC. > > The example you gave is just a simple "read until connection closed" > loop (with, I might add, a security bug of the "format string" type), > and clearly has nothing to do with NNTP. I suggest you throw away > whatever book you got it from, because an author who writes > printf(received_buffer); > is almost certain to have made other equally serious errors.
Technical Details
Message-ID:
<a32ifs$rpp$2@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!newsfeed.media.kyoto-u.ac.jp!news-out.spamkiller.net!propagator-maxim!feed.newsfeeds.com!news-in.spamkiller.net!news.cn99.com!not-for-mailReferences:
<a30rss$f0j$1@mail.cn99.com> <yly9iju1i5.fsf@windlord.stanford.edu> <a31khk$895$1@mail.cn99.com> <87665ntppq.fsf@erlenstar.demon.co.uk>Show Full Headers
Complete Article Headers
Message-ID: <a32ifs$rpp$2@mail.cn99.com> Subject: Re: How recv() determines the receiving is finished? Date: Mon, 28 Jan 2002 10:39:44 +0800 From: "Joshua" <JoshuaIIII@hotmail.com> References: <a30rss$f0j$1@mail.cn99.com> <yly9iju1i5.fsf@windlord.stanford.edu> <a31khk$895$1@mail.cn99.com> <87665ntppq.fsf@erlenstar.demon.co.uk> 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!newsfeed.media.kyoto-u.ac.jp!news-out.spamkiller.net!propagator-maxim!feed.newsfeeds.com!news-in.spamkiller.net!news.cn99.com!not-for-mail Newsgroups: news.software.nntp Organization: Bentium Ltd. (CN99) Lines: 25 NNTP-Posting-Host: 61.156.68.41 X-Trace: mail.cn99.com 1012190526 28473 61.156.68.41 (28 Jan 2002 04:02:06 GMT) X-Complaints-To: usenet@news.cn99.com NNTP-Posting-Date: Mon, 28 Jan 2002 04:02:06 +0000 (UTC) X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200