Skip to content

Commit 9a7498b

Browse files
committed
CCBC-1630: check collection id before storing packet to pipeline
Every time check_collection_id() is invoked, the caller should ensure that this function potentially is rewriting the packet, if it decides to insert/update encoded collection ID. Change-Id: I3d9964c2af04724f95912bc715c76518fba9a5e0 Reviewed-on: https://review.couchbase.org/c/libcouchbase/+/205841 Reviewed-by: Michael Reiche <michael.reiche@couchbase.com> Tested-by: Build Bot <build@couchbase.com>
1 parent 684931e commit 9a7498b

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/mc/mcreq.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,11 @@ static mc_PACKET *check_collection_id(mc_PIPELINE *pipeline, mc_PACKET *packet)
333333

334334
void mcreq_enqueue_packet(mc_PIPELINE *pipeline, mc_PACKET *packet)
335335
{
336+
packet = check_collection_id(pipeline, packet);
337+
336338
nb_SPAN *vspan = &packet->u_value.single;
337339
sllist_append(&pipeline->requests, &packet->slnode);
338340

339-
packet = check_collection_id(pipeline, packet);
340341
netbuf_enqueue_span(&pipeline->nbmgr, &packet->kh_span, packet);
341342
MC_INCR_METRIC(pipeline, bytes_queued, packet->kh_span.size);
342343

0 commit comments

Comments
 (0)