From 6d767eb78ae256375cfe23a0a91ea6e12e046d6b Mon Sep 17 00:00:00 2001 From: dormando Date: Thu, 9 Mar 2023 21:42:42 -0800 Subject: proxy: overhaul backend error handling Cleans up logic around response handling in general. Allows returning server-sent error messages upstream for handling. In general SERVER_ERROR means we can keep the connection to the backend. The rest of the errors are protocol errors, and while some are perfectly safe to whitelist, clients should not be causing those sorts of errors and we should cycle the backend regardless. --- proxy_lua.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'proxy_lua.c') diff --git a/proxy_lua.c b/proxy_lua.c index 25209d0..3297d9f 100644 --- a/proxy_lua.c +++ b/proxy_lua.c @@ -1176,6 +1176,10 @@ static void proxy_register_defines(lua_State *L) { X(MCMC_CODE_OK); X(MCMC_CODE_NOP); X(MCMC_CODE_END); + X(MCMC_CODE_ERROR); + X(MCMC_CODE_CLIENT_ERROR); + X(MCMC_CODE_SERVER_ERROR); + X(MCMC_ERR); X(P_OK); X(CMD_ANY); X(CMD_ANY_STORAGE); -- cgit v1.2.1