]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: spoe: Fix counters update when processing is interrupted
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 26 Apr 2018 09:33:44 +0000 (11:33 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 26 Apr 2018 09:50:18 +0000 (11:50 +0200)
When the processing is interrupted, because of a typo, <nb_sending> was
incremented instead of decremented.

src/flt_spoe.c

index 7c019c412505b15c7ad1a2728f34eb5d43fbea05..40cdd6916d1e51445504b77449ba395a68a7e54a 100644 (file)
@@ -2597,7 +2597,7 @@ spoe_stop_processing(struct spoe_agent *agent, struct spoe_context *ctx)
 
        if (!LIST_ISEMPTY(&ctx->list)) {
                if (ctx->state == SPOE_CTX_ST_SENDING_MSGS)
-                       HA_ATOMIC_ADD(&agent->counters.nb_sending, 1);
+                       HA_ATOMIC_SUB(&agent->counters.nb_sending, 1);
                else
                        HA_ATOMIC_SUB(&agent->counters.nb_waiting, 1);