From: Christopher Faulet Date: Mon, 17 Apr 2023 14:34:29 +0000 (+0200) Subject: BUG/MEDIUM: log: Properly handle client aborts in syslog applet X-Git-Tag: v2.8-dev8~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=285aa40d352ae03e245c48333220b6f37ec74631;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/log.c b/src/log.c index 65b3ce1aff..8af8a49489 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)