diff options
author | Mathias Stearn <mathias@10gen.com> | 2017-07-14 17:54:59 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2017-07-26 15:13:34 -0400 |
commit | a405592e179d9bc704c8e6fb7faac22ade77ecdb (patch) | |
tree | c67c4149f57b4e7f971907f4e48dc8200af47f60 /src/mongo/tools | |
parent | c731446ad3cc399d33b5b2cb28e5b776580f1beb (diff) | |
download | mongo-a405592e179d9bc704c8e6fb7faac22ade77ecdb.tar.gz |
SERVER-30118 Stop setting messageIDs in AbstractMessagingPort::say() and call()
It is now the responsibility of the callers (including the same-named methods
on DBClientConnection) to prepare a ready-to-send Message. AMP's job is now
just to send the provided message as-is.
Diffstat (limited to 'src/mongo/tools')
-rw-r--r-- | src/mongo/tools/bridge.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/tools/bridge.cpp b/src/mongo/tools/bridge.cpp index f08d7ba1c23..3b8d6969485 100644 --- a/src/mongo/tools/bridge.cpp +++ b/src/mongo/tools/bridge.cpp @@ -166,8 +166,6 @@ public: } receivingFirstMessage = false; - int requestId = request.header().getId(); - // Handle a message intended to configure the mongobridge and return a response. // The 'request' is consumed by the mongobridge and does not get forwarded to // 'dest'. @@ -182,7 +180,9 @@ public: auto cmdResponse = replyBuilder->setCommandReply(std::move(commandReply)) .setMetadata(metadata) .done(); - _mp->say(cmdResponse, requestId); + cmdResponse.header().setId(nextMessageId()); + cmdResponse.header().setResponseToMsgId(request.header().getId()); + _mp->say(cmdResponse); continue; } @@ -251,7 +251,7 @@ public: break; } - _mp->say(response, requestId); + _mp->say(response); // If 'exhaust' is true, then instead of trying to receive another message from // '_mp', receive messages from 'dest' until it returns a cursor id of zero. @@ -277,13 +277,13 @@ public: if (qr.getCursorId()) { response.reset(); dest.port().recv(response); - _mp->say(response, requestId); + _mp->say(response); } else { exhaust = false; } } } else { - dest.port().say(request, requestId); + dest.port().say(request); } } catch (const DBException& ex) { error() << "Caught DBException in Forwarder: " << ex << ", end connection " |