mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
rework internal functions - need the parsed list of URIs before massaging; no impact on exposed funcs
This commit is contained in:
parent
d174f6720a
commit
4f5502ef9f
@ -1228,14 +1228,9 @@ ldap_url_duplist (LDAPURLDesc *ludlist)
|
|||||||
return dest;
|
return dest;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int
|
||||||
ldap_url_parselist (LDAPURLDesc **ludlist, const char *url )
|
ldap_url_parselist_int (LDAPURLDesc **ludlist, const char *url, const char *sep,
|
||||||
{
|
int (*url_parse)( const char *, LDAPURLDesc ** ) )
|
||||||
return ldap_url_parselist_ext( ludlist, url, ", " );
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
ldap_url_parselist_ext (LDAPURLDesc **ludlist, const char *url, const char *sep )
|
|
||||||
{
|
{
|
||||||
int i, rc;
|
int i, rc;
|
||||||
LDAPURLDesc *ludp;
|
LDAPURLDesc *ludp;
|
||||||
@ -1254,7 +1249,7 @@ ldap_url_parselist_ext (LDAPURLDesc **ludlist, const char *url, const char *sep
|
|||||||
for (i = 0; urls[i] != NULL; i++) ;
|
for (i = 0; urls[i] != NULL; i++) ;
|
||||||
/* ...and put them in the "stack" backward */
|
/* ...and put them in the "stack" backward */
|
||||||
while (--i >= 0) {
|
while (--i >= 0) {
|
||||||
rc = ldap_url_parse( urls[i], &ludp );
|
rc = url_parse( urls[i], &ludp );
|
||||||
if ( rc != 0 ) {
|
if ( rc != 0 ) {
|
||||||
ldap_charray_free(urls);
|
ldap_charray_free(urls);
|
||||||
ldap_free_urllist(*ludlist);
|
ldap_free_urllist(*ludlist);
|
||||||
@ -1268,6 +1263,18 @@ ldap_url_parselist_ext (LDAPURLDesc **ludlist, const char *url, const char *sep
|
|||||||
return LDAP_URL_SUCCESS;
|
return LDAP_URL_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ldap_url_parselist (LDAPURLDesc **ludlist, const char *url )
|
||||||
|
{
|
||||||
|
return ldap_url_parselist_int( ludlist, url, ", ", ldap_url_parse );
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
ldap_url_parselist_ext (LDAPURLDesc **ludlist, const char *url, const char *sep )
|
||||||
|
{
|
||||||
|
return ldap_url_parselist_int( ludlist, url, sep, ldap_url_parse_ext );
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
ldap_url_parsehosts(
|
ldap_url_parsehosts(
|
||||||
LDAPURLDesc **ludlist,
|
LDAPURLDesc **ludlist,
|
||||||
|
Loading…
Reference in New Issue
Block a user