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

Re: [leafnode-list] Fetchnews Problem



I have been running 1.9.16 with the new getaline() from below since
yesterday.  Everything with SuperNews seems to be working okay now.

Thanks Cornelius.

Jeff

Jeff Grossman (jeff@xxxxxxxxxxx)

----- Original Message -----
From: "Cornelius Krasel" <krasel@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
To: <leafnode-list@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, August 30, 2000 9:50 AM
Subject: Re: [leafnode-list] Fetchnews Problem


> Jeff Grossman wrote:
>
> > No, 1.9.14 works fine for me.  For some reason with .16 and I think .15,
> > Leafnode would not correctly put the last message retreived.  And, for
> some
> > reason I was not getting all of the messages.  This only seemed to
> happen
> > with the Supernews server.  I have since switched back to 1.9.14 and
> > everything is working fine.
>
> If this is true, it is probably the getaline() patch in 1.9.15 which
> causes the trouble. If you feel adventurous (and are interested in
> helping), you might try the following version of getaline (just remove
> the old getaline() function from miscutil.c and put this one in):
>
> /*
>  * Lars Wirzenius: read a line into memory, with no max length
>  * return a pointer to the line, or NULL in case of error
>  *
>  * strip \r at EOL
>  * replace NUL bytes with spaces
>  */
> char *getaline(FILE *f) {
>     static char *buf;       /* buffer for line */
>     static size_t size;     /* size of buffer */
>     size_t len;             /* # of chars stored into buf before '\0' */
>     char * p;
>     int i;
>
>     len = 0;
>     if (!size)
> size = 256;
>     if (!buf)
> buf = critmalloc( size, "reading line" );
>
>     while ((p=fgets(buf+len, size-len, f))) {
> /* replace NUL bytes (which shouldn't be there anyway)
> * with spaces
> */
> i = size - len;
> while ( *p++ != '\n' && i-- > 0 ) {
>     if ( *p == '\0' )
> *p = ' ';
> }
> len += strlen(buf+len);
> if ( buf[len-1] == '\n' )
>     break; /* the whole line has been read */
>
> size += size; /* exponential growth of buffer */
> buf = critrealloc(buf, size, "reading line" );
>     }
>
>     if ( len == 0 )
> return NULL;
>
>     if (len && (buf[len-1] == '\n')) { /* go back on top of the newline */
> --len;
> if (len && (buf[len-1] == '\r')) /* also delete CR */
>     --len;
>     }
>
>     buf[len] = '\0';        /* unconditionally terminate string,
>                                possibly overwriting newline */
>
>     if ( debug )
>         syslog( LOG_DEBUG, "<%s\n", buf );
>     return buf;
> }
>
> I would be very interested whether your problems with Supernews
> persist in that case.
>
> --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
>


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