BUG/MINOR: lua: Fix bitwise logic for hlua_server_check_* functions.

The logical operations were inverted so enable/disable operations did
the opposite.

The bug is present since 1.7 so the fix should be backported there.
This commit is contained in:
Adis Nezirovic 2017-07-26 09:19:06 +02:00 committed by Willy Tarreau
parent 174dfe55a0
commit ceee933862

View File

@ -662,7 +662,7 @@ int hlua_server_check_enable(lua_State *L)
sv = hlua_check_server(L, 1); sv = hlua_check_server(L, 1);
if (sv->check.state & CHK_ST_CONFIGURED) { if (sv->check.state & CHK_ST_CONFIGURED) {
sv->check.state &= ~CHK_ST_ENABLED; sv->check.state |= CHK_ST_ENABLED;
} }
return 0; return 0;
} }
@ -673,7 +673,7 @@ int hlua_server_check_disable(lua_State *L)
sv = hlua_check_server(L, 1); sv = hlua_check_server(L, 1);
if (sv->check.state & CHK_ST_CONFIGURED) { if (sv->check.state & CHK_ST_CONFIGURED) {
sv->check.state |= CHK_ST_ENABLED; sv->check.state &= ~CHK_ST_ENABLED;
} }
return 0; return 0;
} }