mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-21 13:51:26 +02:00
MEDIUM: stats: 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.
This commit is contained in:
parent
a739dc22c5
commit
df15a5d1f3
@ -4441,7 +4441,7 @@ static void http_stats_io_handler(struct appctx *appctx)
|
|||||||
|
|
||||||
res_htx = htx_from_buf(&res->buf);
|
res_htx = htx_from_buf(&res->buf);
|
||||||
|
|
||||||
if (unlikely(sc->state == SC_ST_DIS || sc->state == SC_ST_CLO))
|
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW))))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
/* Check if the input buffer is available. */
|
/* Check if the input buffer is available. */
|
||||||
@ -4450,10 +4450,6 @@ static void http_stats_io_handler(struct appctx *appctx)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check that the output is not closed */
|
|
||||||
if (res->flags & (CF_SHUTW|CF_SHUTW_NOW|CF_SHUTR))
|
|
||||||
appctx->st0 = STAT_HTTP_END;
|
|
||||||
|
|
||||||
/* all states are processed in sequence */
|
/* all states are processed in sequence */
|
||||||
if (appctx->st0 == STAT_HTTP_HEAD) {
|
if (appctx->st0 == STAT_HTTP_HEAD) {
|
||||||
if (stats_send_http_headers(sc, res_htx)) {
|
if (stats_send_http_headers(sc, res_htx)) {
|
||||||
@ -4505,8 +4501,7 @@ static void http_stats_io_handler(struct appctx *appctx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (appctx->st0 == STAT_HTTP_END) {
|
if (appctx->st0 == STAT_HTTP_END) {
|
||||||
if (!(res->flags & CF_SHUTR))
|
se_fl_set(appctx->sedesc, SE_FL_EOS);
|
||||||
sc_shutr(sc);
|
|
||||||
applet_will_consume(appctx);
|
applet_will_consume(appctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user