diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-07-07 15:39:58 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-07-09 13:17:01 -0400 |
commit | 331678a191362dfb79a0243fee7b5f9f619ae338 (patch) | |
tree | 4815611744d5728c8c190c2c252caa823753b83d /src/mongo/rpc | |
parent | 3edf8b672c46e56f4d2e95763a6c0ec6fbbd9018 (diff) | |
download | mongo-331678a191362dfb79a0243fee7b5f9f619ae338.tar.gz |
SERVER-19156 support OP_COMMAND in NetworkInterfaceASIO
Diffstat (limited to 'src/mongo/rpc')
-rw-r--r-- | src/mongo/rpc/factory.cpp | 6 | ||||
-rw-r--r-- | src/mongo/rpc/factory.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/rpc/factory.cpp b/src/mongo/rpc/factory.cpp index ae16d16c62e..29a0a03c6fa 100644 --- a/src/mongo/rpc/factory.cpp +++ b/src/mongo/rpc/factory.cpp @@ -49,7 +49,11 @@ namespace rpc { std::unique_ptr<RequestBuilderInterface> makeRequestBuilder(ProtocolSet clientProtos, ProtocolSet serverProtos) { - switch (uassertStatusOK(negotiate(clientProtos, serverProtos))) { + return makeRequestBuilder(uassertStatusOK(negotiate(clientProtos, serverProtos))); +} + +std::unique_ptr<RequestBuilderInterface> makeRequestBuilder(Protocol proto) { + switch (proto) { case Protocol::kOpQuery: return stdx::make_unique<LegacyRequestBuilder>(); case Protocol::kOpCommandV1: diff --git a/src/mongo/rpc/factory.h b/src/mongo/rpc/factory.h index 2776ffacc47..f2d4e2fd3cb 100644 --- a/src/mongo/rpc/factory.h +++ b/src/mongo/rpc/factory.h @@ -52,6 +52,8 @@ class RequestInterface; std::unique_ptr<RequestBuilderInterface> makeRequestBuilder(ProtocolSet clientProtos, ProtocolSet serverProtos); +std::unique_ptr<RequestBuilderInterface> makeRequestBuilder(Protocol proto); + /** * Returns the appropriate concrete Reply according to the contents of the message. * Throws if one cannot be chosen. |