mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-11 22:15:14 +00:00
MINOR: listener: add a function to return a listener's state as a string
This will be used in debugging output, so it's a short 3-character string.
This commit is contained in:
parent
d6129fca8b
commit
6d0d3f6546
@ -149,6 +149,18 @@ static inline struct bind_conf *bind_conf_alloc(struct proxy *fe, const char *fi
|
||||
return bind_conf;
|
||||
}
|
||||
|
||||
static inline const char *listener_state_str(const struct listener *l)
|
||||
{
|
||||
static const char *states[9] = {
|
||||
"NEW", "INI", "ASS", "PAU", "ZOM", "LIS", "RDY", "FUL", "LIM",
|
||||
};
|
||||
unsigned int st = l->state;
|
||||
|
||||
if (st > sizeof(states) / sizeof(*states))
|
||||
return "INVALID";
|
||||
return states[st];
|
||||
}
|
||||
|
||||
extern struct xfer_sock_list *xfer_sock_list;
|
||||
#endif /* _PROTO_LISTENER_H */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user