Skip to content

Commit 684931e

Browse files
committed
CCBC-1627: fix bodylen value when ffextlen is not zero
Change-Id: I9ce998f4dcdcbdcfb5d71e0cc12d21fcd8f3bdaf Reviewed-on: https://review.couchbase.org/c/libcouchbase/+/204434 Tested-by: Build Bot <build@couchbase.com> Reviewed-by: Trond Norbye <trond.norbye@couchbase.com>
1 parent 7012d8a commit 684931e

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/operations/exists.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ static lcb_STATUS exists_schedule(lcb_INSTANCE *instance, std::shared_ptr<lcb_CM
165165

166166
hdr.request.opcode = PROTOCOL_BINARY_CMD_GET_META;
167167
hdr.request.datatype = PROTOCOL_BINARY_RAW_BYTES;
168-
hdr.request.bodylen = ntohl(mcreq_get_key_size(&hdr));
168+
hdr.request.bodylen = ntohl(mcreq_get_key_size(&hdr) + framing_extras.size());
169169
hdr.request.opaque = pkt->opaque;
170170
hdr.request.cas = 0;
171171

src/operations/get_replica.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ static lcb_STATUS get_replica_schedule(lcb_INSTANCE *instance, std::shared_ptr<l
409409
mcreq_reserve_key(pl, pkt, sizeof(req.bytes) + ffextlen, &keybuf, cmd->collection().collection_id());
410410
size_t nkey = pkt->kh_span.size - MCREQ_PKT_BASESIZE + pkt->extlen;
411411
req.request.keylen = htons((uint16_t)nkey);
412-
req.request.bodylen = htonl((uint32_t)nkey);
412+
req.request.bodylen = htonl((uint32_t)nkey + framing_extras.size());
413413
req.request.opaque = pkt->opaque;
414414
rck->remaining++;
415415
mcreq_write_hdr(pkt, &req);

src/operations/unlock.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ static lcb_STATUS unlock_schedule(lcb_INSTANCE *instance, std::shared_ptr<lcb_CM
169169

170170
hdr.request.opcode = PROTOCOL_BINARY_CMD_UNLOCK_KEY;
171171
hdr.request.datatype = PROTOCOL_BINARY_RAW_BYTES;
172-
hdr.request.bodylen = htonl(mcreq_get_key_size(&hdr));
172+
hdr.request.bodylen = htonl(mcreq_get_key_size(&hdr) + framing_extras.size());
173173
hdr.request.opaque = pkt->opaque;
174174
hdr.request.cas = lcb_htonll(cmd->cas());
175175

0 commit comments

Comments
 (0)