Skip to content

Commit 052ce4b

Browse files
trondndaverigby
authored andcommitted
Add setOpaque to BinprotCommand
Change-Id: Ic8938e8a1e6e486bf3beecc881addf557eee1a04 Reviewed-on: http://review.couchbase.org/110276 Tested-by: Build Bot <[email protected]> Reviewed-by: Dave Rigby <[email protected]>
1 parent be09eca commit 052ce4b

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

protocol/connection/client_mcbp_commands.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void BinprotCommand::fillHeader(cb::mcbp::Request& header,
6969
header.setVBucket(vbucket);
7070
header.setBodylen(gsl::narrow<uint32_t>(key.size() + extlen + payload_len +
7171
frame_info.size()));
72-
header.setOpaque(0xdeadbeef);
72+
header.setOpaque(opaque);
7373
// @todo fix this to use the setter. There is still some dependency
7474
// in other tests which use expects this to be in the same byte order
7575
// as the server sent it..
@@ -131,6 +131,11 @@ BinprotCommand& BinprotCommand::setVBucket(Vbid vbid) {
131131
return *this;
132132
}
133133

134+
BinprotCommand& BinprotCommand::setOpaque(uint32_t opaq) {
135+
opaque = opaq;
136+
return *this;
137+
}
138+
134139
BinprotCommand& BinprotCommand::addFrameInfo(const FrameInfo& fi) {
135140
auto encoded = fi.encode();
136141
return addFrameInfo({encoded.data(), encoded.size()});

protocol/connection/client_mcbp_commands.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ class BinprotCommand {
5454

5555
BinprotCommand& setVBucket(Vbid vbid);
5656

57+
BinprotCommand& setOpaque(uint32_t opaq);
58+
5759
/// Add a frame info object to the stream
5860
BinprotCommand& addFrameInfo(const FrameInfo& fi);
5961

@@ -133,6 +135,7 @@ class BinprotCommand {
133135
std::string key;
134136
uint64_t cas = 0;
135137
Vbid vbucket = Vbid(0);
138+
uint32_t opaque{0xdeadbeef};
136139

137140
/// The frame info sections to inject into the packet
138141
std::vector<uint8_t> frame_info;

0 commit comments

Comments
 (0)