Skip to content

Commit

Permalink
FEATURE: touch command
Browse files Browse the repository at this point in the history
Reflected the mentioned issue.
  • Loading branch information
cheesecrust committed Jul 8, 2024
1 parent 7429d16 commit 61f5d75
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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");
Expand Down Expand Up @@ -13130,16 +13130,15 @@ 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);
}

}

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];
Expand Down

0 comments on commit 61f5d75

Please sign in to comment.