summaryrefslogtreecommitdiff
path: root/src/mongo/rpc/object_check.h
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2016-08-22 14:49:31 -0400
committerTess Avitabile <tess.avitabile@mongodb.com>2016-09-02 15:10:30 -0400
commitf288ea86db58c6aefe4807ed7ac1815577da2752 (patch)
treedadff64105fe94dfeef57c00a38c1e4ff960ca07 /src/mongo/rpc/object_check.h
parentaa7411e6e2c4fd18bbff934c57567d89dc3efa0e (diff)
downloadmongo-f288ea86db58c6aefe4807ed7ac1815577da2752.tar.gz
SERVER-25159 Default BSON validation version should depend on admin.system.version
Diffstat (limited to 'src/mongo/rpc/object_check.h')
-rw-r--r--src/mongo/rpc/object_check.h12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/rpc/object_check.h b/src/mongo/rpc/object_check.h
index 8c8be115136..c4f999fde20 100644
--- a/src/mongo/rpc/object_check.h
+++ b/src/mongo/rpc/object_check.h
@@ -44,12 +44,16 @@ class Status;
*/
template <>
struct Validator<BSONObj> {
- static BSONVersion validateVersion();
+ inline static BSONVersion enabledBSONVersion() {
+ return serverGlobalParams.featureCompatibilityVersion.load() ==
+ ServerGlobalParams::FeatureCompatibilityVersion_34
+ ? BSONVersion::kV1_1
+ : BSONVersion::kV1_0;
+ }
inline static Status validateLoad(const char* ptr, size_t length) {
- return serverGlobalParams.objcheck
- ? validateBSON(ptr, length, enableBSON1_1 ? BSONVersion::kV1_1 : BSONVersion::kV1_0)
- : Status::OK();
+ return serverGlobalParams.objcheck ? validateBSON(ptr, length, enabledBSONVersion())
+ : Status::OK();
}
static Status validateStore(const BSONObj& toStore);