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 cadab22..6ba601d 100644
--- a/src/log.c
+++ b/src/log.c
@@ -3577,6 +3577,9 @@
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_budget:
/* it may remain some stuff to do, let's retry later */
appctx_wakeup(appctx);
-
return;
parse_error:
@@ -3677,16 +3679,17 @@
_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;
}