diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-06-19 18:14:15 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-06-28 11:57:04 -0400 |
commit | e777062a8a4a6084472039e8d1d4008f42f777fb (patch) | |
tree | 8b1d6621062a6265a8baf3db676ed42e6d09394f /src/mongo/rpc/legacy_reply.cpp | |
parent | 4d3756aca8409150628e8c62712f6ca10616d2cb (diff) | |
download | mongo-e777062a8a4a6084472039e8d1d4008f42f777fb.tar.gz |
SERVER-29734 Merge body and metadata in OP_QUERY reply handling
Diffstat (limited to 'src/mongo/rpc/legacy_reply.cpp')
-rw-r--r-- | src/mongo/rpc/legacy_reply.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/mongo/rpc/legacy_reply.cpp b/src/mongo/rpc/legacy_reply.cpp index 7728a444532..5de4cedb553 100644 --- a/src/mongo/rpc/legacy_reply.cpp +++ b/src/mongo/rpc/legacy_reply.cpp @@ -43,10 +43,10 @@ namespace mongo { namespace rpc { -LegacyReply::LegacyReply(const Message* message) : _message(std::move(message)) { +LegacyReply::LegacyReply(const Message* message) { invariant(message->operation() == opReply); - QueryResult::View qr = _message->singleData().view2ptr(); + QueryResult::View qr = message->singleData().view2ptr(); // should be checked by caller. invariant(qr.msgdata().getNetworkOp() == opReply); @@ -75,13 +75,14 @@ LegacyReply::LegacyReply(const Message* message) : _message(std::move(message)) << causedBy(status), status.isOK()); - std::tie(_commandReply, _metadata) = rpc::upconvertReplyMetadata(BSONObj(qr.data())); + _commandReply = BSONObj(qr.data()); + _commandReply.shareOwnershipWith(message->sharedBuffer()); return; } const BSONObj& LegacyReply::getMetadata() const { - return _metadata; + return _commandReply; } const BSONObj& LegacyReply::getCommandReply() const { |