πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #78836

Re: AUTHINFO problem

#78836
From: Niz
Date: Sun, 16 Mar 2008 15:08
43 lines
2940 bytes
On 2008-03-16 14:07:07 +0000, Xavier Roche 
<xroche@free.fr.NOSPAM.invalid> said:

> Niz a Γ©crit :
>>     send(sock, loginName, sizeof(loginName), 0);
>>     recv(sock, buffer, bufsize, 0);
> 
> Humm, this is not a protocol issue, and this is IMHO off-topic in 
> news.software.nntp

Ah, sorry about that. I assumed it was just for general NNTP software 
enquires which I would class this as. I've been trying to find some 
decent information on NNTP in general.

> - careflly check and handle the send/recv returncode(s) (man recv and man send)
> - loop until recv() a complete line, because there is no guarantee that 
> the reply will be received at once ("The receive calls normally return 
> any  data  available,  up  to  the requested amount, rather than 
> waiting for receipt of the full amount requested.")
> 
> using something like (typo/syntax not checked):
> 
> int readLine((int sock, char *buffer, size_t bufsize) {
>    ssize_t ret, size;
>    for(size = 0 ; size < buffsize && (ret = recv(sock, buffer + size, 
> bufsize - size, 0)) >=0 ; size += ret) {
>     /* loop until end of line reached */
>      if (size > 2 && buffer[size - 2] == '\r' && buffer[size - 1] == '\n') {
>        break;
>      }
>    }
>    return (ret >= 0 && size < buffsize);  /* ok ? */
> }
> 
> ..
> if (readLine(sock, buffer, bufsize)) {
> ..
> } else {
> .. error handling
> }

Thank you for the advice. I'll look into it a bit more.
Technical Details
Message-ID: <2008031615083316807-niz@nicetrycom>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
References: <2008031611435716807-niz@nicetrycom> <frj1aj$7rt$1@news.trigofacile.com> <2008031613051775249-niz@nicetrycom> <frj662$mmf$1@news.httrack.net> <2008031613334150073-niz@nicetrycom> <frj9i0$mmf$2@news.httrack.net>

Show Full Headers
Complete Article Headers
Message-ID: <2008031615083316807-niz@nicetrycom>
Subject: Re: AUTHINFO problem
Date: Sun, 16 Mar 2008 15:08:33 +0000
From: Niz <niz@nicetry.com>
References: <2008031611435716807-niz@nicetrycom> <frj1aj$7rt$1@news.trigofacile.com> <2008031613051775249-niz@nicetrycom> <frj662$mmf$1@news.httrack.net> <2008031613334150073-niz@nicetrycom> <frj9i0$mmf$2@news.httrack.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.20141118.mbox.gz!number1.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Sun, 16 Mar 2008 10:08:33 -0500
Newsgroups: news.software.nntp
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
User-Agent: Unison/1.8.1
Lines: 43
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-5JmKe3Jt7EjvPu8P3Z/A5GQnBnKmHCwLMChaVp5ACyQfHdBSmIVNHUqZSqAouzkfjxhggrqtpQi9ZZ0!LlD+Dp46UuG/p5eSQsFlq37GLLdpK065VE+3cqglw5Cg00o8XyrRIYAvk0ocmQ==
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint
 properly
X-Postfilter: 1.3.37