mcuadros / go-syslog

Syslog server library for go.
http://godoc.org/gopkg.in/mcuadros/go-syslog.v2
MIT License
523 stars 143 forks source link

Problems with Scanner and syslog lines without \n #10

Closed middelink closed 9 years ago

middelink commented 9 years ago

The use of a bufio.Scanner assumes (by default) syslog messages end in a \n. This is often not the case, Esp. on UDP, 1 datagram == 1 syslog frame and the message part is allowed to fill the rest of the packet.

Also http://www.ietf.org/rfc/rfc3164.txt $4.1.3 clearly states the MSG part has no ending delimiter.

abligh commented 9 years ago

See also #15 - I think on UDP we shouldn't be using a split function at all. The end of the packet is the delimiter.

abligh commented 9 years ago

This pull request may fix this: https://github.com/abligh/go-syslog/commit/df573444e870c589591445efd55b4c953580a83f