/* Update a server state using the parameters available in the params list */
static void srv_update_state(struct server *srv, int version, char **params)
{
- int msg_default_len;
char *p;
- struct chunk *msg = get_trash_chunk();
+ struct chunk *msg;
/* fields since version 1
* and common to all other upcoming versions
int bk_f_forced_id;
int srv_f_forced_id;
- chunk_printf(msg, "server-state application failed for server '%s/%s'", srv->proxy->id, srv->id);
- msg_default_len = msg->len;
+ msg = get_trash_chunk();
switch (version) {
case 1:
/*
/* don't apply anything if one error has been detected */
- if (msg->len > msg_default_len)
+ if (msg->len)
goto out;
/* recover operational state and apply it to this server
}
out:
- if (msg->len > msg_default_len) {
- chunk_appendf(msg, "\n");
- Warning(msg->str);
- }
-
+ if (msg->len)
+ Warning("server-state application failed for server '%s/%s'%s",
+ srv->proxy->id, srv->id, msg->str);
}
/* This function parses all the proxies and only take care of the backends (since we're looking for server)