From: David Carlier <[email protected]>
The scheduler sets the first byte of the shared map to '0' while it
rewrites the data file path. Any non-zero byte was taken as a pending
update, so a request could read a partial path and emit a spurious
"invalid path" alert. '0' is now treated as no update, as the nginx
module does.
This should be backported to lower branches.
---
addons/deviceatlas/da.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/addons/deviceatlas/da.c b/addons/deviceatlas/da.c
index 30c75517e..cb6f02db3 100644
--- a/addons/deviceatlas/da.c
+++ b/addons/deviceatlas/da.c
@@ -286,7 +286,7 @@ static void da_haproxy_checkinst(void)
char *base;
base = (char *)global_deviceatlas.atlasmap;
- if (base[0] != 0) {
+ if (base[0] != 0 && base[0] != '0') {
FILE *jsonp;
void *cnew, *cold;
da_status_t status;
@@ -297,7 +297,7 @@ static void da_haproxy_checkinst(void)
#ifdef USE_THREAD
if (HA_SPIN_TRYLOCK(OTHER_LOCK, &dadwsch_lock) != 0)
return;
- if (base[0] == 0) {
+ if (base[0] == 0 || base[0] == '0') {
HA_SPIN_UNLOCK(OTHER_LOCK, &dadwsch_lock);
return;
}
--
2.55.0