]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: server: use functions to detect state changes and to update them
authorWilly Tarreau <w@1wt.eu>
Tue, 13 May 2014 17:27:31 +0000 (19:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 13 May 2014 20:18:22 +0000 (22:18 +0200)
commitc5150dafd82f70882fc379d145e8cf25625d815d
treec2da11ef43b667d7a5f327a378e306403f288bd4
parent02615f9b163ba717794b5801611b4ea46ad5f63c
MINOR: server: use functions to detect state changes and to update them

Detecting that a server's status has changed is a bit messy, as well
as it is to commit the status changes. We'll have to add new conditions
soon and we'd better avoid to multiply the number of touched locations
with the high risk of forgetting them.

This commit introduces :
  - srv_lb_status_changed() to report if the status changed from the
    previously committed one ;
  - svr_lb_commit_status() to commit the current status

The function is now used by all load-balancing algorithms.
include/proto/backend.h
src/lb_chash.c
src/lb_fas.c
src/lb_fwlc.c
src/lb_fwrr.c
src/lb_map.c
src/server.c