diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-06-10 09:04:01 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-06-16 16:25:38 -0400 |
commit | 2bf407c955f383a29d3d10fc6be273d9c6890961 (patch) | |
tree | 31fd0be5d44d1fff9fae387cc37ad5f9c82e544e /src/mongo/rpc/legacy_reply_builder.cpp | |
parent | b6b9e3ecd726bf9c36155e2dccd67f825a95800c (diff) | |
download | mongo-2bf407c955f383a29d3d10fc6be273d9c6890961.tar.gz |
SERVER-18236 send GLEStats over OP_COMMAND metadata object
Diffstat (limited to 'src/mongo/rpc/legacy_reply_builder.cpp')
-rw-r--r-- | src/mongo/rpc/legacy_reply_builder.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/mongo/rpc/legacy_reply_builder.cpp b/src/mongo/rpc/legacy_reply_builder.cpp index 4ed4ff88886..343e6874d4f 100644 --- a/src/mongo/rpc/legacy_reply_builder.cpp +++ b/src/mongo/rpc/legacy_reply_builder.cpp @@ -31,6 +31,7 @@ #include "mongo/db/dbmessage.h" #include "mongo/db/jsobj.h" #include "mongo/rpc/legacy_reply_builder.h" +#include "mongo/rpc/metadata.h" #include "mongo/stdx/memory.h" #include "mongo/util/assert_util.h" @@ -50,14 +51,17 @@ namespace rpc { LegacyReplyBuilder& LegacyReplyBuilder::setMetadata(BSONObj metadata) { invariant(_state == State::kMetadata); - // no op for now: SERVER-18236 + _metadata = std::move(metadata); _state = State::kCommandReply; return *this; } LegacyReplyBuilder& LegacyReplyBuilder::setRawCommandReply(BSONObj commandReply) { invariant(_state == State::kCommandReply); - commandReply.appendSelfToBufBuilder(_builder); + BSONObj downconvertedCommandReply = uassertStatusOK( + rpc::downconvertReplyMetadata(std::move(commandReply), std::move(_metadata)) + ); + downconvertedCommandReply.appendSelfToBufBuilder(_builder); _state = State::kOutputDocs; return *this; } |