]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[MINOR] add the "initial weight" to the server struct.
authorWilly Tarreau <w@1wt.eu>
Sat, 10 Oct 2009 17:34:06 +0000 (19:34 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 10 Oct 2009 17:34:06 +0000 (19:34 +0200)
This one will be used when changing weights.

include/types/server.h
src/cfgparse.c

index d7e6da0b8a3e9e223897c9dc26f3fc8585f5bcbd..f6a7171bfeaa84515a590ee78af308b4f82e2285 100644 (file)
@@ -122,7 +122,7 @@ struct server {
        int curfd;                              /* file desc used for current test, or -1 if not in test */
 
        char *id;                               /* just for identification */
-       unsigned uweight, eweight;              /* user-specified weight, and effective weight */
+       unsigned iweight,uweight, eweight;      /* initial weight, user-specified weight, and effective weight */
        unsigned wscore;                        /* weight score, used during srv map computation */
        unsigned prev_eweight;                  /* eweight before last change */
        unsigned rweight;                       /* remainer of weight in the current LB tree */
index 4eade38e897d9c622b8c315328f43faed431ae10..428d7b93a812ee4774740cd26749a8e0045b9361 100644 (file)
@@ -2538,7 +2538,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                newsrv->rise = DEF_RISETIME;
                newsrv->fall = DEF_FALLTIME;
                newsrv->health = newsrv->rise; /* up, but will fall down at first failure */
-               newsrv->uweight = 1;
+               newsrv->uweight = newsrv->iweight = 1;
                newsrv->maxqueue = 0;
                newsrv->slowstart = 0;
 
@@ -2695,7 +2695,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                                        err_code |= ERR_ALERT | ERR_FATAL;
                                        goto out;
                                }
-                               newsrv->uweight = w;
+                               newsrv->uweight = newsrv->iweight = w;
                                cur_arg += 2;
                        }
                        else if (!strcmp(args[cur_arg], "minconn")) {