]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: applet: Remove uselelss test on SE_FL_SHR/SHW flags
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Feb 2024 06:56:50 +0000 (07:56 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 14 Feb 2024 13:22:36 +0000 (14:22 +0100)
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.

src/cache.c
src/cli.c
src/dns.c
src/flt_spoe.c
src/hlua.c
src/http_client.c
src/log.c
src/peers.c
src/sink.c
src/stats.c

index 0cbc96a78bdfc2af03d1d434581b53ebfd0de8a3..2120d877e144c2e698c283f5437ae0a8f44c1507 100644 (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);
 
index f3b015ab0e63b035958b18cc5996c687a7ea0d7a..f5b5203bb1349f4987b39e87f09a79cc8b5a7e10 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -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;
        }
index 23e9d9de538b00b816e06349ab46d2472f2ca1dd..a88aa6eb12b540ce02a767e9791b87b69dfc8d47 100644 (file)
--- a/src/dns.c
+++ b/src/dns.c
@@ -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;
        }
index 70ea2bab6707cd1ef8ac345066eb71383a6a9597..d83eff9bf8d1d451c58c43e12bb00e82c375af02 100644 (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;
        }
index b0abf5fa5a13e7b97062d2bc6ed42f059519b4e9..fb04602b4effd425e8c236a236aa4735d5bbac4a 100644 (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);
index d7e50c016ec82ff95565e5239e495ee5ae4ecc5e..4f40475aca2fb277dd24a710b8b860424f97307a 100644 (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));
index a71f206060bc50b41f4b5c304b354130f3094b0c..5e704cddb1dadb3128810fce27ea2c07ad52adeb 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -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;
        }
index 5ed0e3f68e78b6eb895d1f4e783954feeba76cc4..ddb9f2f7dfc0bb713c735c2d614a670ae03371f0 100644 (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;
        }
index 66c2b8c77f2fa468f499a92dc7052950f073f2b1..a5cd60657a3c02fe3360f47aaf7cee6b0ef9f789 100644 (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))
index 50943b9906e8aad3c9868fbb48bafa35ee51ad9e..1c2f750420c7a018f360b74721547e115b0c6ae6 100644 (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;
        }