MINOR: ring: make sure ring_dispatch waits when facing a changing message
authorWilly Tarreau <w@1wt.eu>
Thu, 29 Feb 2024 10:55:22 +0000 (11:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Mar 2024 17:34:19 +0000 (17:34 +0000)
commitcb482f92c4caa401dbc0ed7c564efa275af3b5c1
tree3a3f82160428426db9025849922c3c0d83aca7f3
parent31b93b40b0200fe2d288e169126249a38289f123
MINOR: ring: make sure ring_dispatch waits when facing a changing message

The writer is using tags 0xFF instead of readers count at the front of
messages that are undergoing an update, while the tail has already been
updated. The reader needs to take care of this because it can face these
messages and mistakenly parse data that's still being written, leading
to corruption (especially if this happens while the size is changing).

Let's just stop reading when facing reserved codes, since they indicate
that the end of usable messages was reached.
src/ring.c