]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: filters: Call stream_set_backend callbacks before updating backend stats
authorChristopher Faulet <christopher.faulet@capflam.org>
Tue, 21 Jun 2016 09:54:52 +0000 (11:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 9 Nov 2016 21:50:55 +0000 (22:50 +0100)
So if an internal error is returned, the number of cumulated connections on the
backend is not incremented.

src/proxy.c

index 8a6004e8ddff93c29ea6fa61a6253e1f39dace84..dc6d3e1c6f955daf141084aa6c84b03cd1ab6e74 100644 (file)
@@ -1131,15 +1131,16 @@ int stream_set_backend(struct stream *s, struct proxy *be)
 {
        if (s->flags & SF_BE_ASSIGNED)
                return 1;
+
+       if (flt_set_stream_backend(s, be) < 0)
+               return 0;
+
        s->be = be;
        be->beconn++;
        if (be->beconn > be->be_counters.conn_max)
                be->be_counters.conn_max = be->beconn;
        proxy_inc_be_ctr(be);
 
-       if (flt_set_stream_backend(s, be) < 0)
-               return 0;
-
        /* assign new parameters to the stream from the new backend */
        s->si[1].flags &= ~SI_FL_INDEP_STR;
        if (be->options2 & PR_O2_INDEPSTR)