summaryrefslogtreecommitdiff
path: root/proto_text.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2022-09-27 22:09:22 -0700
committerdormando <dormando@rydia.net>2022-10-20 14:43:53 -0700
commit493bb69af53f3e34ba87ad002c4a9f6c49470b2b (patch)
tree131349984d57b58a1f7fea8560c966e20c0767f4 /proto_text.c
parentcedaf5586883ffd2323307f45f90f4d70e94ecc2 (diff)
downloadmemcached-493bb69af53f3e34ba87ad002c4a9f6c49470b2b.tar.gz
meta: remove excess spaces from meta responses
was returning "HD \r\n" and "HD Oetc\r\n" - not to protocol spec.
Diffstat (limited to 'proto_text.c')
-rw-r--r--proto_text.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/proto_text.c b/proto_text.c
index dc6c624..ab1130f 100644
--- a/proto_text.c
+++ b/proto_text.c
@@ -1560,8 +1560,8 @@ static void process_mdelete_command(conn *c, token_t *tokens, const size_t ntoke
char *errstr = "CLIENT_ERROR bad command line format";
assert(c != NULL);
mc_resp *resp = c->resp;
- // reserve 3 bytes for status code
- char *p = resp->wbuf + 3;
+ // reserve bytes for status code
+ char *p = resp->wbuf + 2;
WANT_TOKENS_MIN(ntokens, 3);
@@ -1617,7 +1617,7 @@ static void process_mdelete_command(conn *c, token_t *tokens, const size_t ntoke
c->thread->stats.delete_misses++;
pthread_mutex_unlock(&c->thread->stats.mutex);
- memcpy(resp->wbuf, "EX ", 3);
+ memcpy(resp->wbuf, "EX", 2);
goto cleanup;
}
@@ -1638,9 +1638,9 @@ static void process_mdelete_command(conn *c, token_t *tokens, const size_t ntoke
if (c->noreply)
resp->skip = true;
if (settings.meta_response_old) {
- memcpy(resp->wbuf, "OK ", 3);
+ memcpy(resp->wbuf, "OK", 2);
} else {
- memcpy(resp->wbuf, "HD ", 3);
+ memcpy(resp->wbuf, "HD", 2);
}
} else {
pthread_mutex_lock(&c->thread->stats.mutex);
@@ -1652,9 +1652,9 @@ static void process_mdelete_command(conn *c, token_t *tokens, const size_t ntoke
if (c->noreply)
resp->skip = true;
if (settings.meta_response_old) {
- memcpy(resp->wbuf, "OK ", 3);
+ memcpy(resp->wbuf, "OK", 2);
} else {
- memcpy(resp->wbuf, "HD ", 3);
+ memcpy(resp->wbuf, "HD", 2);
}
}
goto cleanup;
@@ -1663,7 +1663,7 @@ static void process_mdelete_command(conn *c, token_t *tokens, const size_t ntoke
c->thread->stats.delete_misses++;
pthread_mutex_unlock(&c->thread->stats.mutex);
- memcpy(resp->wbuf, "NF ", 3);
+ memcpy(resp->wbuf, "NF", 2);
goto cleanup;
}
cleanup: