balabit/syslog-ng-3.4 — pull request #17 by algernon (2012-10-11 10:36:09+00:00)
Title: afsocket: Use the "dgram" proto for dgram sockets

When applying a transport to a socket, don't just set the transport,
but also set logproto_name properly: "dgram" for SOCK_DGRAM sockets,
"text" for everything else.

If this is not done, and our socket is SOCK_DGRAM, we'd use the text
proto, which after the refactoring, would look for a terminating new
line, instead of datagram boundary - and it wouldn't find it, which
will result in partial messages accumulating in a buffer, to
eventually be sent out as garbage.

This patch simply makes it so that SOCK_DGRAM will use the "dgram"
logproto, which does the right thing, and knows about datagram
boundaries.

Reported-by: Peter Czanik
Signed-off-by: Gergely Nagy