Skip to content

Commit daadcbb

Browse files
author
Christian Hergert
committed
uri: ensure journal is set in write concern when journal=true.
Fixes CDRIVER-389.
1 parent 47e2edf commit daadcbb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/mongoc/mongoc-uri.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,12 @@ _mongoc_uri_build_write_concern (mongoc_uri_t *uri) /* IN */
581581
wtimeoutms = bson_iter_int32 (&iter);
582582
}
583583

584+
if (bson_iter_init_find_case (&iter, &uri->options, "journal") &&
585+
BSON_ITER_HOLDS_BOOL (&iter) &&
586+
bson_iter_bool (&iter)) {
587+
mongoc_write_concern_set_journal (write_concern, true);
588+
}
589+
584590
if (bson_iter_init_find_case (&iter, &uri->options, "w")) {
585591
if (BSON_ITER_HOLDS_INT32 (&iter)) {
586592
value = bson_iter_int32 (&iter);

0 commit comments

Comments
 (0)