summaryrefslogtreecommitdiff
path: root/proxy_lua.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-08-01 11:19:14 -0700
committerdormando <dormando@rydia.net>2022-08-03 11:53:33 -0700
commit2520054b152863babbc01cd5d7bab5d5f7705667 (patch)
tree180bb6b56e3c47a1b8b49bf6ec7c39d9a357b83e /proxy_lua.c
parent2389436317fe9d74d390d0adfe4a2679c693375e (diff)
downloadmemcached-2520054b152863babbc01cd5d7bab5d5f7705667.tar.gz
proxy: add r:has_flag(), fix r:token() length
Add mcp.request function for quick checking if a flag exists in a request string. Also updates internal code for checking the length of a token to use the endcap properly, and uses that for the r:token(n) requets as well, which fixes a subtle bug of the token length being too long.
Diffstat (limited to 'proxy_lua.c')
-rw-r--r--proxy_lua.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/proxy_lua.c b/proxy_lua.c
index 383f747..c01d327 100644
--- a/proxy_lua.c
+++ b/proxy_lua.c
@@ -782,6 +782,7 @@ int proxy_register_libs(LIBEVENT_THREAD *t, void *ctx) {
{"rtrimkey", mcplib_request_rtrimkey},
{"token", mcplib_request_token},
{"ntokens", mcplib_request_ntokens},
+ {"has_flag", mcplib_request_has_flag},
{"__tostring", NULL},
{"__gc", mcplib_request_gc},
{NULL, NULL}