Date: Tue Oct 18 16:15:08 2016 -0400
|
|
On CDRIVER-1527-cmd-with-opts: fix write concern validate
|
|
diff --cc src/mongoc/mongoc-write-concern.c
|
index af3e8d5,af3e8d5..4d628af
|
--- a/src/mongoc/mongoc-write-concern.c
|
+++ b/src/mongoc/mongoc-write-concern.c
|
@@@ -624,12 -624,12 +624,15 @@@ _mongoc_write_concern_iter_is_valid (bs
|
has_fsync = bson_iter_bool (&inner);
|
}
|
else if (BSON_ITER_IS_KEY (&inner, "w")) {
|
-- if (!BSON_ITER_HOLDS_INT32 (&inner)) {
|
-- return false;
|
-- }
|
-- if (bson_iter_int32 (&inner) == MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED ||
|
-- bson_iter_int32 (&inner) == MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED) {
|
++ if (BSON_ITER_HOLDS_INT32 (&inner) &&
|
++ (bson_iter_int32 (&inner) == MONGOC_WRITE_CONCERN_W_UNACKNOWLEDGED ||
|
++ bson_iter_int32 (&inner) == MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED)) {
|
w0 = true;
|
++ } else if (BSON_ITER_HOLDS_UTF8 (&inner) ||
|
++ BSON_ITER_HOLDS_DOCUMENT (&inner)) {
|
++ /* "majority" or tag sets or any future write concern name is ok */
|
++ } else {
|
++ return false;
|
}
|
}
|