MINOR: applet: Remove uselelss test on SE_FL_SHR/SHW flags

These both flags are set after releasing the applet, in
appctx_shut(). Concretly, it means the applet is shutdown for reads and
writes. Once set, the applet's I/O handler was no longer called. Tests on
these flags are useless. There is no chance to match them.
This commit is contained in:
Christopher Faulet 2024-02-14 07:56:50 +01:00
parent 5df45cff8f
commit dcd917d972
10 changed files with 12 additions and 10 deletions

View File

@ -1788,8 +1788,9 @@ static void http_cache_io_handler(struct appctx *appctx)
goto exit;
}
if (unlikely(applet_fl_test(appctx, APPCTX_FL_EOS|APPCTX_FL_ERROR|APPCTX_FL_SHUTDOWN)))
if (unlikely(applet_fl_test(appctx, APPCTX_FL_EOS|APPCTX_FL_ERROR))) {
goto exit;
}
res_htx = htx_from_buf(&appctx->outbuf);

View File

@ -917,7 +917,7 @@ static void cli_io_handler(struct appctx *appctx)
int reql;
int len;
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
co_skip(sc_oc(sc), co_data(sc_oc(sc)));
goto out;
}

View File

@ -443,7 +443,7 @@ static void dns_session_io_handler(struct appctx *appctx)
size_t len, cnt, ofs;
int ret = 0;
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
co_skip(sc_oc(sc), co_data(sc_oc(sc)));
goto out;
}

View File

@ -1930,7 +1930,7 @@ spoe_handle_appctx(struct appctx *appctx)
if (SPOE_APPCTX(appctx) == NULL)
return;
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
co_skip(sc_oc(sc), co_data(sc_oc(sc)));
goto out;
}

View File

@ -2312,7 +2312,7 @@ static void hlua_socket_handler(struct appctx *appctx)
struct hlua_csk_ctx *ctx = appctx->svcctx;
struct stconn *sc = appctx_sc(appctx);
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
co_skip(sc_oc(sc), co_data(sc_oc(sc)));
notification_wake(&ctx->wake_on_read);
notification_wake(&ctx->wake_on_write);

View File

@ -704,7 +704,7 @@ void httpclient_applet_io_handler(struct appctx *appctx)
uint32_t sz;
int ret;
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
if (co_data(res)) {
htx = htx_from_buf(&res->buf);
co_htx_skip(res, htx, co_data(res));

View File

@ -4220,7 +4220,7 @@ 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)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
co_skip(sc_oc(sc), co_data(sc_oc(sc)));
goto out;
}

View File

@ -3025,7 +3025,7 @@ static void peer_io_handler(struct appctx *appctx)
unsigned int maj_ver, min_ver;
int prev_state;
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW)))) {
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
co_skip(sc_oc(sc), co_data(sc_oc(sc)));
goto out;
}

View File

@ -312,8 +312,9 @@ static void sink_forward_io_handler(struct appctx *appctx)
size_t len, cnt, ofs, last_ofs;
int ret = 0;
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR|SE_FL_SHR|SE_FL_SHW))))
if (unlikely(se_fl_test(appctx->sedesc, (SE_FL_EOS|SE_FL_ERROR)))) {
goto out;
}
/* if stopping was requested, close immediately */
if (unlikely(stopping))

View File

@ -4509,7 +4509,7 @@ static void http_stats_io_handler(struct appctx *appctx)
res_htx = htx_from_buf(&appctx->outbuf);
if (unlikely(applet_fl_test(appctx, APPCTX_FL_EOS|APPCTX_FL_ERROR|APPCTX_FL_SHUTDOWN))) {
if (unlikely(applet_fl_test(appctx, APPCTX_FL_EOS|APPCTX_FL_ERROR))) {
appctx->st0 = STAT_HTTP_END;
goto out;
}