From: Christopher Faulet Date: Fri, 31 Mar 2023 09:17:13 +0000 (+0200) Subject: MEDIUM: log: Use the sedesc to report and detect end of processing X-Git-Tag: v2.8-dev7~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22a88f06d46c407a4455c83fb8cd30b3f8f76b22;p=thirdparty%2Fhaproxy.git MEDIUM: log: Use the sedesc to report and detect end of processing Just like for other applets, we now use the SE descriptor instead of the channel to report error and end-of-stream. Here, the refactoring only reports errors by setting SE_FL_ERROR flag. --- diff --git a/src/log.c b/src/log.c index cadab225a3..6ba601d42c 100644 --- a/src/log.c +++ b/src/log.c @@ -3577,6 +3577,9 @@ static void syslog_io_handler(struct appctx *appctx) char *message; size_t size; + if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) + goto out; + max_accept = l->bind_conf->maxaccept ? l->bind_conf->maxaccept : 1; while (co_data(sc_oc(sc))) { char c; @@ -3669,7 +3672,6 @@ missing_data: missing_budget: /* it may remain some stuff to do, let's retry later */ appctx_wakeup(appctx); - return; parse_error: @@ -3677,16 +3679,17 @@ parse_error: _HA_ATOMIC_INC(&l->counters->failed_req); _HA_ATOMIC_INC(&frontend->fe_counters.failed_req); - goto close; + goto error; cli_abort: if (l->counters) _HA_ATOMIC_INC(&l->counters->cli_aborts); _HA_ATOMIC_INC(&frontend->fe_counters.cli_aborts); -close: - sc_shutw(sc); - sc_shutr(sc); +error: + se_fl_set(appctx->sedesc, SE_FL_ERROR); + +out: return; }