* Subroutine for parse_connection_string * * Deal with a URI connection string. */
| 6139 | * Deal with a URI connection string. |
| 6140 | */ |
| 6141 | static PQconninfoOption * |
| 6142 | conninfo_uri_parse(const char *uri, PQExpBuffer errorMessage, |
| 6143 | bool use_defaults) |
| 6144 | { |
| 6145 | PQconninfoOption *options; |
| 6146 | |
| 6147 | /* Make a working copy of PQconninfoOptions */ |
| 6148 | options = conninfo_init(errorMessage); |
| 6149 | if (options == NULL) |
| 6150 | return NULL; |
| 6151 | |
| 6152 | if (!conninfo_uri_parse_options(options, uri, errorMessage)) |
| 6153 | { |
| 6154 | PQconninfoFree(options); |
| 6155 | return NULL; |
| 6156 | } |
| 6157 | |
| 6158 | /* |
| 6159 | * Add in defaults if the caller wants that. |
| 6160 | */ |
| 6161 | if (use_defaults) |
| 6162 | { |
| 6163 | if (!conninfo_add_defaults(options, errorMessage)) |
| 6164 | { |
| 6165 | PQconninfoFree(options); |
| 6166 | return NULL; |
| 6167 | } |
| 6168 | } |
| 6169 | |
| 6170 | return options; |
| 6171 | } |
| 6172 | |
| 6173 | /* |
| 6174 | * conninfo_uri_parse_options |
no test coverage detected