diff --git a/proto_text.c b/proto_text.c index ab1130f186..649def6486 100644 --- a/proto_text.c +++ b/proto_text.c @@ -1758,11 +1758,7 @@ static void process_marithmetic_command(conn *c, token_t *tokens, const size_t n case OK: if (c->noreply) resp->skip = true; - if (settings.meta_response_old) { - memcpy(resp->wbuf, "OK ", 3); - } else { - memcpy(resp->wbuf, "HD ", 3); - } + // *it was filled, set the status below. break; case NON_NUMERIC: errstr = "CLIENT_ERROR cannot increment or decrement non-numeric value"; @@ -1785,7 +1781,7 @@ static void process_marithmetic_command(conn *c, token_t *tokens, const size_t n item_created = true; } else { // Not sure how we can get here if we're holding the lock. - memcpy(resp->wbuf, "NS ", 3); + memcpy(resp->wbuf, "NS", 2); } } else { errstr = "SERVER_ERROR Out of memory allocating new item"; @@ -1800,14 +1796,14 @@ static void process_marithmetic_command(conn *c, token_t *tokens, const size_t n } pthread_mutex_unlock(&c->thread->stats.mutex); // won't have a valid it here. - memcpy(p, "NF ", 3); - p += 3; + memcpy(p, "NF", 2); + p += 2; } break; case DELTA_ITEM_CAS_MISMATCH: // also returns without a valid it. - memcpy(p, "EX ", 3); - p += 3; + memcpy(p, "EX", 2); + p += 2; break; } diff --git a/t/metaget.t b/t/metaget.t index 06f1623c6e..f9538fc7c1 100644 --- a/t/metaget.t +++ b/t/metaget.t @@ -210,16 +210,16 @@ my $sock = $server->sock; { diag "marithmetic tests"; print $sock "ma mo\r\n"; - like(scalar <$sock>, qr/^NF/, "incr miss"); + like(scalar <$sock>, qr/^NF\r/, "incr miss"); print $sock "ma mo D1\r\n"; - like(scalar <$sock>, qr/^NF/, "incr miss with argument"); + like(scalar <$sock>, qr/^NF\r/, "incr miss with argument"); print $sock "set mo 0 0 1\r\n1\r\n"; like(scalar <$sock>, qr/^STORED/, "stored with set"); print $sock "ma mo\r\n"; - like(scalar <$sock>, qr/^HD/, "incr'd a set value"); + like(scalar <$sock>, qr/^HD\r/, "incr'd a set value"); print $sock "set mo 0 0 1\r\nq\r\n"; like(scalar <$sock>, qr/^STORED/, "stored with set"); @@ -228,7 +228,7 @@ my $sock = $server->sock; like(scalar <$sock>, qr/^CLIENT_ERROR /, "cannot incr non-numeric value"); print $sock "ma mu N90\r\n"; - like(scalar <$sock>, qr/^HD/, "incr with seed"); + like(scalar <$sock>, qr/^HD\r/, "incr with seed"); my $res = mget($sock, 'mu', 's t v Ofoo k'); ok(keys %$res, "not a miss"); ok(find_flags($res, 'st'), "got main flags back"); @@ -258,7 +258,7 @@ my $sock = $server->sock; is($res->{val}, '0', 'land at 0 for over-decrement'); print $sock "ma mi q D1\r\nmn\r\n"; - like(scalar <$sock>, qr/^MN/, "quiet increment"); + like(scalar <$sock>, qr/^MN\r/, "quiet increment"); # CAS routines. $res = marith($sock, 'mc', 'N0 c v');