From ddd233ebb7cbb882bc9b1ec67777551ad442aa57 Mon Sep 17 00:00:00 2001 From: cheesecrust Date: Fri, 5 Jul 2024 10:41:41 +0900 Subject: [PATCH] =?UTF-8?q?feat=20#487=20-=20touch=20=EB=AA=85=EB=A0=B9?= =?UTF-8?q?=EC=96=B4=20=EC=8B=A4=ED=96=89=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- memcached.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/memcached.c b/memcached.c index 05043412..74de62e9 100644 --- a/memcached.c +++ b/memcached.c @@ -13085,6 +13085,21 @@ static void process_setattr_command(conn *c, token_t *tokens, const size_t ntoke } } +static void process_touch_command(conn *c, token_t *tokens, const size_t ntokens) +{ + assert(c != NULL); + assert(c->ewouldblock == false); + char *key = tokens[KEY_TOKEN].value; + size_t nkey = tokens[KEY_TOKEN].length; + + if (nkey > KEY_MAX_LENGTH) { + out_string(c, "CLIENT_ERROR bad command line format"); + return; + } + + out_string(c, "hi touch!!") +} + static void process_command_ascii(conn *c, char *command, int cmdlen) { /* One more token is reserved in tokens strucure @@ -13206,6 +13221,10 @@ static void process_command_ascii(conn *c, char *command, int cmdlen) { process_config_command(c, tokens, ntokens); } + else if ((ntokens >= 0) && (strcmp(tokens[COMMAND_TOKEN].value, "touch") == 0)) + { + process_touch_command(c, tokens, ntokens); + } #ifdef ENABLE_ZK_INTEGRATION else if ((ntokens >= 3) && (strcmp(tokens[COMMAND_TOKEN].value, "zkensemble") == 0)) {