Commit 2663321c authored by Michele Tartara's avatar Michele Tartara

Improve the reception of replies in the confd client

If a received reply is valid and there is still no valid reply,
keep it, no matter how new it is.
Signed-off-by: default avatarMichele Tartara <mtartara@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 855f9bad
......@@ -86,7 +86,8 @@ updateConfdReply :: ConfdReply -> Maybe ConfdReply -> Maybe ConfdReply
updateConfdReply newValue Nothing = Just newValue
updateConfdReply newValue (Just currentValue) = Just $
if confdReplyStatus newValue == ReplyStatusOk
&& confdReplySerial newValue > confdReplySerial currentValue
&& (confdReplyStatus currentValue /= ReplyStatusOk
|| confdReplySerial newValue > confdReplySerial currentValue)
then newValue
else currentValue
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment