diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-08-22 14:49:31 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2016-09-02 15:10:30 -0400 |
commit | f288ea86db58c6aefe4807ed7ac1815577da2752 (patch) | |
tree | dadff64105fe94dfeef57c00a38c1e4ff960ca07 /src/mongo/rpc/object_check.h | |
parent | aa7411e6e2c4fd18bbff934c57567d89dc3efa0e (diff) | |
download | mongo-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.h | 12 |
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); |