You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ((maxStalenessSeconds=zend_hash_str_find(props, "maxStalenessSeconds", sizeof("maxStalenessSeconds") -1))) {
93
93
if (Z_TYPE_P(maxStalenessSeconds) ==IS_LONG) {
94
-
if (Z_LVAL_P(maxStalenessSeconds) <MONGOC_SMALLEST_MAX_STALENESS_SECONDS) {
95
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"maxStalenessSeconds\" integer field to be >= %d", ZSTR_VAL(php_phongo_readpreference_ce->name), MONGOC_SMALLEST_MAX_STALENESS_SECONDS);
96
-
goto failure;
97
-
}
98
-
if (Z_LVAL_P(maxStalenessSeconds) >INT32_MAX) {
99
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"maxStalenessSeconds\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_readpreference_ce->name), INT32_MAX);
100
-
goto failure;
101
-
}
102
-
if (mongoc_read_prefs_get_mode(intern->read_preference) ==MONGOC_READ_PRIMARY) {
103
-
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"maxStalenessSeconds\" array field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_readpreference_ce->name));
104
-
goto failure;
94
+
if (Z_LVAL_P(maxStalenessSeconds) !=MONGOC_NO_MAX_STALENESS) {
95
+
if (mongoc_read_prefs_get_mode(intern->read_preference) ==MONGOC_READ_PRIMARY) {
96
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"maxStalenessSeconds\" field to not be present with \"primary\" mode", ZSTR_VAL(php_phongo_readpreference_ce->name));
97
+
goto failure;
98
+
}
99
+
if (Z_LVAL_P(maxStalenessSeconds) <MONGOC_SMALLEST_MAX_STALENESS_SECONDS) {
100
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"maxStalenessSeconds\" integer field to be >= %d", ZSTR_VAL(php_phongo_readpreference_ce->name), MONGOC_SMALLEST_MAX_STALENESS_SECONDS);
101
+
goto failure;
102
+
}
103
+
if (Z_LVAL_P(maxStalenessSeconds) >INT32_MAX) {
104
+
phongo_throw_exception(PHONGO_ERROR_INVALID_ARGUMENT, "%s initialization requires \"maxStalenessSeconds\" integer field to be <= %"PRId32, ZSTR_VAL(php_phongo_readpreference_ce->name), INT32_MAX);
0 commit comments