At 12:07 PM 9/8/2005, M. Kellermann wrote:
At 16:21 08.09.2005, you wrote:
At 07:36 AM 9/8/2005, M. Kellermann wrote:
hi list,

since there was no response for over a month i'll try it again:

when using the -t logfile option (debugging disabled) qpopper logs to the given
file instead of syslog. but i see blank lines between the entries...?
example:
Aug 17 17:14:39.768 2005 [20525] (v4.0.8) Servicing request from blabla
Aug 17 17:14:39.768 2005
Aug 17 17:14:39.829 2005 [20525] Stats: username 0 0 0 0 blabla
Aug 17 17:14:39.829 2005
Aug 17 17:14:40.968 2005 [20528] (v4.0.8) Servicing request from blabla
Aug 17 17:14:40.968 2005
Aug 17 17:14:41.013 2005 [20528] Stats: username 0 0 0 0 blabla
Aug 17 17:14:41.013 2005

huh? is this normal behaviour?

The code in the function vlogit() in common/logit.c explicitly does this. I have no idea WHY it explicitly does this, but it does. You'll find there two fprintf() calls followed by an fflush(). The second fprintf is the issue.

Anyone know why? Should we just remove the second fprintf?

i tried removing the second fprintf, and now my logit.c looks like this:
.....
        date_time = ctime ( (time_t *) &tval.tv_sec );
        pDate     = date_time + 4; /* skip day of week name */
        iDateLen  = strlen ( pDate ); /* length including year */
        pYear     = pDate + ( iDateLen - 5 ); /* point to start of year */
        date_time [ iDateLen - 2 ] = '\0'; /* cut off the year */
lMsec = (tval.tv_usec + 500) / 1000; /* convert useconds to milliseconds */
        fprintf ( str, "%s.%03ld %.4s [%ld] %s\n",
                  pDate, lMsec, pYear, (long) getpid(), msgbuf );
        fflush  ( str );
    }
    else {
        syslog ( loglev, "%s", msgbuf) ;
    }

    if ( iChunk == -1 ) {
        /*
         * We blew out the format buffer.
         */
        if ( str ) {
            fprintf ( str, "%s [%ld] Buffer size exceeded logging msg: %s\n",
                      date_time, (long) getpid(), format );
            fflush  ( str );
        }
        else {
.....

but it doesnt solve the blank lines.... ;(

You're sure it recompiled and you placed the new executable in place of the old one?


C has never been my friend....but, doesnt the \n in the fprintf statement
mean "new line" ??

It does, however if you were to remove the \n from the remaining fprintf, then all your output would wind up on one line, with no line ends. The \n on Unix systems puts out a linefeed, which is a line end. On DOS/Windows systems it'd put out a CR/LF. You really do need that \n.

The fact is you're getting more than just blank lines, you're getting lines with timestamp and other info. That info is coming from the second fprintf, thus my question about whether the executable got built right and is really in use now.


any programmers hints welcome...


thanks

MK



qpopper is started via xinetd:
        server          =       /usr/sbin/popper
        server_args     =       qpopper -s -R -t /var/log/pop.log

logging works fine .... but where do these empty lines with just
the timestamp and no logging text come from?

is noone but me logging to a separate file?
i cant believe that this is a qpopper bug...

thanks again in advance

MK

Reply via email to