Skip to content

Commit

Permalink
meta: fix CAS ('c') return values
Browse files Browse the repository at this point in the history
This should now align with the binary protocol. It might make sense for
this to return the _current_ CAS value of the underlying item in the
cases of EX... binprot does not currently do this, and the storage code
is shared between binary and text so I can't change them independently.
  • Loading branch information
dormando committed Jan 12, 2022
1 parent 7af02b0 commit 706d47e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion proto_text.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static void _finalize_mset(conn *c, enum store_item_type ret) {
// We don't have the CAS until this point, which is why we
// generate this line so late.
META_CHAR(p, 'c');
p = itoa_u64(ITEM_get_cas(it), p);
p = itoa_u64(c->cas, p);
break;
default:
break;
Expand Down Expand Up @@ -1408,6 +1408,8 @@ static void process_mset_command(conn *c, token_t *tokens, const size_t ntokens)

// Set noreply after tokens are understood.
c->noreply = of.no_reply;
// Clear cas return value
c->cas = 0;

bool has_error = false;
for (i = KEY_TOKEN+1; i < ntokens-1; i++) {
Expand Down

0 comments on commit 706d47e

Please sign in to comment.