mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-19 09:01:05 +01:00
[MINOR] set the log socket receive window to zero bytes
The syslog UDP socket may receive data, which is not cool because those data accumulate in the system buffers up to the receive socket buffer size. To prevent this, we set the receive window to zero and try to shutdown(SHUT_RD) the socket.
This commit is contained in:
parent
7c1ffc1e8f
commit
530b9dde00
@ -163,6 +163,9 @@ void send_log(struct proxy *p, int level, const char *message, ...)
|
||||
if (logfd < 0) {
|
||||
if ((logfd = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
|
||||
return;
|
||||
/* we don't want to receive anything on this socket */
|
||||
setsockopt(logfd, SOL_SOCKET, SO_RCVBUF, &zero, sizeof(zero));
|
||||
shutdown(logfd, SHUT_RD); /* does nothing under Linux, maybe needed for others */
|
||||
}
|
||||
|
||||
if (level < 0 || progname == NULL || message == NULL)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user