Skip to content

Commit

Permalink
feat naver#487 - touch 명령어 실행 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
cheesecrust committed Jul 5, 2024
1 parent f1995f0 commit ddd233e
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions memcached.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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))
{
Expand Down

0 comments on commit ddd233e

Please sign in to comment.