OSSP CVS Repository

ossp - Ticket #23
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Attach]  [Edit]  [History

Ticket 23: Prefix channel buffer bug when '\n' character present

When using the prefix channel along with fsl, any two subsequent calls to syslog in which the first one has length > n and the second one has lenght < n with the second one ending in a \n character produces three log lines: the first two are the expected log lines and the third one is the (lenght - n) characters of the first syslog call. It looks like some sort of buffer cleaning problem. It was not tested wheter or not this happens when prefix is used without fsl. To reproduce, a single program like this suffices:

int main(void){

    openlog("test", LOG_PID,LOG_LOCAL7);
    syslog(LOG_INFO, "000000000000000000000000000000000000000000000000000000000000");

    syslog(LOG_INFO, "11111111111111111111111111111111111111111111111111111\n");
}

which produces the output: (timestamp added by prefix channel)

[2003-10-31, 11:40:22] 000000000000000000000000000000000000000000000000000000000000
[2003-10-31, 11:40:22] 11111111111111111111111111111111111111111111111111111
00000

Note: only the prefix channel and the file channel were specified int the config file for this test. The error does not appear when only the file channel is present.

[Add remarks]

Remarks:

Properties:

Type: code           Version: 0.9.4 
Status: new          Created: 2003-Oct-31 17:54
Severity:          Last Change: 2003-Oct-31 17:54
Priority:          Subsystem: l2 
Assigned To: rse           Derived From:  
Creator: anonymous 

Related Check-ins:

2003-Nov-06 16:31 Check-in [3668]: fix PR#23: l2 does not terminate a message when it contains a newline (By thl)

CVSTrac 2.0.1