summaryrefslogtreecommitdiff
path: root/src/mongo/rpc/protocol.cpp
diff options
context:
space:
mode:
authorSpencer T Brody <spencer@mongodb.com>2015-11-18 17:07:50 -0500
committerSpencer T Brody <spencer@mongodb.com>2015-11-19 23:32:47 -0500
commit874fc812768718f015e81d6ce7bd2dab9ce14128 (patch)
tree073e256b8e5f6757155029e74358391d87274318 /src/mongo/rpc/protocol.cpp
parent5b3257d526f8217e303609418da1769275f81d03 (diff)
downloadmongo-874fc812768718f015e81d6ce7bd2dab9ce14128.tar.gz
SERVER-21486 Redact bypassDocumentValidation from user privilege set when being talked to by a 3.0 mongos
Diffstat (limited to 'src/mongo/rpc/protocol.cpp')
-rw-r--r--src/mongo/rpc/protocol.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/rpc/protocol.cpp b/src/mongo/rpc/protocol.cpp
index 3c3cafb6479..040cceb4dd5 100644
--- a/src/mongo/rpc/protocol.cpp
+++ b/src/mongo/rpc/protocol.cpp
@@ -36,7 +36,9 @@
#include "mongo/base/string_data.h"
#include "mongo/bson/util/bson_extract.h"
#include "mongo/db/jsobj.h"
+#include "mongo/db/operation_context.h"
#include "mongo/db/wire_version.h"
+#include "mongo/util/decorable.h"
#include "mongo/util/mongoutils/str.h"
namespace mongo {
@@ -54,8 +56,19 @@ const char kOpQueryOnly[] = "opQueryOnly";
const char kOpCommandOnly[] = "opCommandOnly";
const char kAll[] = "all";
+const OperationContext::Decoration<Protocol> operationProtocolDecoration =
+ OperationContext::declareDecoration<Protocol>();
+
} // namespace
+Protocol getOperationProtocol(OperationContext* txn) {
+ return operationProtocolDecoration(txn);
+}
+
+void setOperationProtocol(OperationContext* txn, Protocol protocol) {
+ operationProtocolDecoration(txn) = protocol;
+}
+
StatusWith<Protocol> negotiate(ProtocolSet fst, ProtocolSet snd) {
using std::begin;
using std::end;