@@ -1040,22 +1040,30 @@ mongoc_uri_apply_options (mongoc_uri_t *uri,
1040
1040
* also recognised as 32-bit ints.
1041
1041
*/
1042
1042
if (mongoc_uri_option_is_int64 (key )) {
1043
- if (!_mongoc_uri_parse_int64 (key , value , & v_int64 )) {
1044
- goto UNSUPPORTED_VALUE ;
1045
- }
1043
+ if (0 < strlen (value )) {
1044
+ if (!_mongoc_uri_parse_int64 (key , value , & v_int64 )) {
1045
+ goto UNSUPPORTED_VALUE ;
1046
+ }
1046
1047
1047
- if (!_mongoc_uri_set_option_as_int64_with_error (
1048
- uri , canon , v_int64 , error )) {
1049
- return false;
1048
+ if (!_mongoc_uri_set_option_as_int64_with_error (
1049
+ uri , canon , v_int64 , error )) {
1050
+ return false;
1051
+ }
1052
+ } else {
1053
+ MONGOC_WARNING ("Empty value provided for \"%s\"" , key );
1050
1054
}
1051
1055
} else if (mongoc_uri_option_is_int32 (key )) {
1052
- if (!mongoc_uri_parse_int32 (key , value , & v_int )) {
1053
- goto UNSUPPORTED_VALUE ;
1054
- }
1056
+ if (0 < strlen (value )) {
1057
+ if (!mongoc_uri_parse_int32 (key , value , & v_int )) {
1058
+ goto UNSUPPORTED_VALUE ;
1059
+ }
1055
1060
1056
- if (!_mongoc_uri_set_option_as_int32_with_error (
1057
- uri , canon , v_int , error )) {
1058
- return false;
1061
+ if (!_mongoc_uri_set_option_as_int32_with_error (
1062
+ uri , canon , v_int , error )) {
1063
+ return false;
1064
+ }
1065
+ } else {
1066
+ MONGOC_WARNING ("Empty value provided for \"%s\"" , key );
1059
1067
}
1060
1068
} else if (!strcmp (key , MONGOC_URI_W )) {
1061
1069
if (* value == '-' || isdigit (* value )) {
@@ -1070,36 +1078,40 @@ mongoc_uri_apply_options (mongoc_uri_t *uri,
1070
1078
}
1071
1079
1072
1080
} else if (mongoc_uri_option_is_bool (key )) {
1073
- if (0 == strcasecmp (value , "true" )) {
1074
- bval = true;
1075
- } else if (0 == strcasecmp (value , "false" )) {
1076
- bval = false;
1077
- } else if ((0 == strcmp (value , "1" )) ||
1078
- (0 == strcasecmp (value , "yes" )) ||
1079
- (0 == strcasecmp (value , "y" )) ||
1080
- (0 == strcasecmp (value , "t" ))) {
1081
- MONGOC_WARNING ("Deprecated boolean value for \"%s\": \"%s\", "
1082
- "please update to \"%s=true\"" ,
1083
- key ,
1084
- value ,
1085
- key );
1086
- bval = true;
1087
- } else if ((0 == strcasecmp (value , "0" )) ||
1088
- (0 == strcasecmp (value , "-1" )) ||
1089
- (0 == strcmp (value , "no" )) || (0 == strcmp (value , "n" )) ||
1090
- (0 == strcmp (value , "f" ))) {
1091
- MONGOC_WARNING ("Deprecated boolean value for \"%s\": \"%s\", "
1092
- "please update to \"%s=false\"" ,
1093
- key ,
1094
- value ,
1095
- key );
1096
- bval = false;
1097
- } else {
1098
- goto UNSUPPORTED_VALUE ;
1099
- }
1081
+ if (0 < strlen (value )) {
1082
+ if (0 == strcasecmp (value , "true" )) {
1083
+ bval = true;
1084
+ } else if (0 == strcasecmp (value , "false" )) {
1085
+ bval = false;
1086
+ } else if ((0 == strcmp (value , "1" )) ||
1087
+ (0 == strcasecmp (value , "yes" )) ||
1088
+ (0 == strcasecmp (value , "y" )) ||
1089
+ (0 == strcasecmp (value , "t" ))) {
1090
+ MONGOC_WARNING ("Deprecated boolean value for \"%s\": \"%s\", "
1091
+ "please update to \"%s=true\"" ,
1092
+ key ,
1093
+ value ,
1094
+ key );
1095
+ bval = true;
1096
+ } else if ((0 == strcasecmp (value , "0" )) ||
1097
+ (0 == strcasecmp (value , "-1" )) ||
1098
+ (0 == strcmp (value , "no" )) || (0 == strcmp (value , "n" )) ||
1099
+ (0 == strcmp (value , "f" ))) {
1100
+ MONGOC_WARNING ("Deprecated boolean value for \"%s\": \"%s\", "
1101
+ "please update to \"%s=false\"" ,
1102
+ key ,
1103
+ value ,
1104
+ key );
1105
+ bval = false;
1106
+ } else {
1107
+ goto UNSUPPORTED_VALUE ;
1108
+ }
1100
1109
1101
- if (!mongoc_uri_set_option_as_bool (uri , canon , bval )) {
1102
- return false;
1110
+ if (!mongoc_uri_set_option_as_bool (uri , canon , bval )) {
1111
+ return false;
1112
+ }
1113
+ } else {
1114
+ MONGOC_WARNING ("Empty value provided for \"%s\"" , key );
1103
1115
}
1104
1116
1105
1117
} else if (!strcmp (key , MONGOC_URI_READPREFERENCETAGS )) {
0 commit comments