diff options
author | dormando <dormando@rydia.net> | 2023-03-09 21:42:42 -0800 |
---|---|---|
committer | dormando <dormando@rydia.net> | 2023-03-26 16:48:37 -0700 |
commit | 6d767eb78ae256375cfe23a0a91ea6e12e046d6b (patch) | |
tree | 4af8645e47c16e718a727969590041d17c0e6762 /proxy_lua.c | |
parent | 5910b652428ac96dc6d9917d4bc73d8d400ab0f3 (diff) | |
download | memcached-6d767eb78ae256375cfe23a0a91ea6e12e046d6b.tar.gz |
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.
Diffstat (limited to 'proxy_lua.c')
-rw-r--r-- | proxy_lua.c | 4 |
1 files changed, 4 insertions, 0 deletions
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); |