[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [leafnode-list] getaline()



Mike Castle wrote:

> Ok,  I think getaline() in miscutil.c is wrong about something.

getaline() is a function which is supposed to read text (as opposed
to binary files).

>         size += size+100;

Already present this way in leafnode-1.0.1. It may well be that this
is a typo by Arnt and it is supposed to be "size += 100;". Actually,
this would make some sense - however, I am not sure what would happen
if you tried to read a very long line (you would end up with a large
number of realloc() calls).

> Second, the logic behind the idea that, if you didn't read an entire line,
> it's because the buffer wasn't large enough, is completely bogus when
> dealing with sockets.  Packets don't have to end on a new line boundary.
> So I could see it possible the stdio buffering to cause all sorts of funny
> things to happen here.

NNTP is a line-oriented protocol. Messages are transferred as clear-text,
and lines end always with \r\n. Leafnode/Fetchnews does never see packets;
it is completely unaware of the existence of them. (The same is true for
any other NNTP server/client I have looked at.)

--Cornelius.

-- 
/* Cornelius Krasel, U Wuerzburg, Dept. of Pharmacology, Versbacher Str. 9 */
/* D-97078 Wuerzburg, Germany   email: phak004@xxxxxxxxxxxxxxxxxxxxxx  SP4 */
/* "Science is the game we play with God to find out what His rules are."  */

-- 
leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx -- mailing list for leafnode
To unsubscribe, send mail with "unsubscribe" in the subject to the list