Skip to content

Commit 64788c1

Browse files
ac000hanumantmk
authored andcommitted
client: Fix setting of the connectTimeoutMS value
When specifying the connectTimeoutMS option in the URI e.g ?connectTimeoutMS=250 this would be added internally under the name as specified, ie in this case connectTimeoutMS however when mongoc_client_connect_tcp() comes to look for this setting, it does so case sensitively as all lowercase, i.e if ((options = mongoc_uri_get_options (uri)) && bson_iter_init_find (&iter, options, "connecttimeoutms") && and won't find the setting and will use the default connectTimeoutMS value instead. It should use bson_iter_init_find_case() instead for a case insensitive search. Signed-off-by: Andrew Clayton <[email protected]> Closes #178
1 parent 6d4e69e commit 64788c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/mongoc/mongoc-client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ mongoc_client_connect_tcp (const mongoc_uri_t *uri,
9393
bson_return_val_if_fail (host, NULL);
9494

9595
if ((options = mongoc_uri_get_options (uri)) &&
96-
bson_iter_init_find (&iter, options, "connecttimeoutms") &&
96+
bson_iter_init_find_case (&iter, options, "connecttimeoutms") &&
9797
BSON_ITER_HOLDS_INT32 (&iter)) {
9898
if (!(connecttimeoutms = bson_iter_int32(&iter))) {
9999
connecttimeoutms = MONGOC_DEFAULT_CONNECTTIMEOUTMS;

0 commit comments

Comments
 (0)