From 61f5d75b37a6fb0be961971ec9c59b66252b286a Mon Sep 17 00:00:00 2001 From: cheesecrust Date: Mon, 8 Jul 2024 11:37:25 +0900 Subject: [PATCH] FEATURE: touch command Reflected the mentioned issue. --- memcached.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/memcached.c b/memcached.c index fddb5345..613149a6 100644 --- a/memcached.c +++ b/memcached.c @@ -13090,8 +13090,8 @@ 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; // get users key input - size_t nkey = tokens[KEY_TOKEN].length; // + char *key = tokens[KEY_TOKEN].value; + size_t nkey = tokens[KEY_TOKEN].length; ENGINE_ERROR_CODE ret = ENGINE_SUCCESS; @@ -13100,7 +13100,7 @@ static void process_touch_command(conn *c, token_t *tokens, const size_t ntokens int64_t exptime=0; - if ((! safe_strtoll(tokens[KEY_TOKEN+1].value, &exptime))) + if (! safe_strtoll(tokens[KEY_TOKEN+1].value, &exptime)) { print_invalid_command(c, tokens, ntokens); out_string(c, "CLIENT_ERROR bad command line format"); @@ -13130,8 +13130,7 @@ static void process_touch_command(conn *c, token_t *tokens, const size_t ntokens break; default: STATS_CMD_NOKEY(c, setattr); - if (ret == ENGINE_EBADATTR) out_string(c, "ATTR_ERROR not found"); - else if (ret == ENGINE_EBADVALUE) out_string(c, "ATTR_ERROR bad value"); + if (ret == ENGINE_EBADVALUE) out_string(c, "ATTR_ERROR bad value"); else handle_unexpected_errorcode_ascii(c, __func__, ret); } @@ -13139,7 +13138,7 @@ static void process_touch_command(conn *c, token_t *tokens, const size_t ntokens static void process_command_ascii(conn *c, char *command, int cmdlen) { - /* One more token is reserved in tokens structure + /* One more token is reserved in tokens strucure * for keeping the length of untokenized command. */ token_t tokens[MAX_TOKENS+1];