BUG/MINOR: server: Be sure to cut the last parsed field of a server-state line
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 19 Feb 2021 15:57:20 +0000 (16:57 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 22 Feb 2021 09:34:45 +0000 (10:34 +0100)
commit8c5b974f282729abefb617671e7c5910347555fa
treef00440484d01b737cee785b41258cc0acbbc8f6d
parentd119e5671ace438224c51e6603d1e146981a224b
BUG/MINOR: server: Be sure to cut the last parsed field of a server-state line

If a line of a server-state file has too many fields, the last one is not
cut on the first following space, as all other fileds. It contains all the
end of the line. It is not the expected behavior. So, now, we cut it on the
next following space, if any. The parsing loop was slighly rewritten.

Note that for now there is no error reported if the line is too long.

This patch may be backported at least as far as 2.1. On 2.0 and prior the
code is not the same. The line parsing is inlined in apply_server_state()
function.

(cherry picked from commit 868a5757e584431fafe713546c8ef8e799865476)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/server.c