From 285aa40d352ae03e245c48333220b6f37ec74631 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 17 Apr 2023 16:34:29 +0200 Subject: [PATCH] BUG/MEDIUM: log: Properly handle client aborts in syslog applet In the syslog applet, when there is no output data, nothing is performed and the applet leaves by requesting more data. But it is an issue because a client abort is only handled if it reported with the last bytes of the message. If the abort occurs after the message was handled, it is ignored. The session remains opened and inactive until the client timeout is being triggered. It no such timeout is configured, given that the default maxconn is 10, all slots can be quickly busy and make the applet unresponsive. To fix the issue, the best is to always try to read a message when the I/O handle is called. This way, the abort can be handled. And if there is no data, we leave as usual. This patch should fix the issue #2112. It must be backported as far as 2.4. --- src/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index 65b3ce1af..8af8a4948 100644 --- a/src/log.c +++ b/src/log.c @@ -3583,7 +3583,7 @@ static void syslog_io_handler(struct appctx *appctx) } max_accept = l->bind_conf->maxaccept ? l->bind_conf->maxaccept : 1; - while (co_data(sc_oc(sc))) { + while (1) { char c; if (max_accept <= 0)