Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 16c9a1e

Browse files
committed
PHP-1511: append_gle should ignore unset fsync/journal from link
1 parent f9d8e51 commit 16c9a1e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

collection.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,11 +378,13 @@ static zval* append_getlasterror(zval *coll, mongo_buffer *buf, zval *options, m
378378
php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The 'MongoCursor::$timeout' static property is deprecated, please call MongoCursor->timeout() instead");
379379
}
380380

381-
/* Get the default value for journalling */
382-
fsync = link->servers->options.default_fsync;
383-
journal = link->servers->options.default_journal;
384-
385381
/* Read the default_* properties from the link */
382+
if (link->servers->options.default_fsync != -1) {
383+
fsync = link->servers->options.default_fsync;
384+
}
385+
if (link->servers->options.default_journal != -1) {
386+
journal = link->servers->options.default_journal;
387+
}
386388
if (link->servers->options.default_w != -1) {
387389
w = link->servers->options.default_w;
388390
}

0 commit comments

Comments
 (0)