]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/url.c
rename ldap_pvt_init_utils() to ldap_int_utils_init() and provide
[openldap] / libraries / libldap / url.c
index 781ff2f6f5c2401860740cacdcdd39d027dcce5c..ed6f8a889e6d9da1766ac1f19d8a5da2d34f4c4e 100644 (file)
@@ -105,7 +105,7 @@ ldap_url_parse( LDAP_CONST char *url_in, LDAPURLDesc **ludpp )
        const char *url_tmp;
        char *url;
 
-       Debug( LDAP_DEBUG_TRACE, "ldap_url_parse(%s)\n", url, 0, 0 );
+       Debug( LDAP_DEBUG_TRACE, "ldap_url_parse(%s)\n", url_in, 0, 0 );
 
        *ludpp = NULL;  /* pessimistic */
 
@@ -255,24 +255,24 @@ ldap_url_search( LDAP *ld, LDAP_CONST char *url, int attrsonly )
        int             err;
        LDAPURLDesc     *ludp;
        BerElement      *ber;
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
        LDAPServer      *srv = NULL;
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
 
        if ( ldap_url_parse( url, &ludp ) != 0 ) {
                ld->ld_errno = LDAP_PARAM_ERROR;
                return( -1 );
        }
 
-       if (( ber = ldap_build_search_req( ld, ludp->lud_dn, ludp->lud_scope,
-           ludp->lud_filter, ludp->lud_attrs, attrsonly, NULL, NULL )) == NULLBER ) {
+       ber = ldap_build_search_req( ld, ludp->lud_dn, ludp->lud_scope,
+           ludp->lud_filter, ludp->lud_attrs, attrsonly, NULL, NULL,
+               -1, -1 );
+
+       if ( ber == NULLBER ) {
                return( -1 );
        }
 
        err = 0;
 
        if ( ludp->lud_host != NULL || ludp->lud_port != 0 ) {
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
                if (( srv = (LDAPServer *)calloc( 1, sizeof( LDAPServer )))
                    == NULL || ( srv->lsrv_host = strdup( ludp->lud_host ==
                    NULL ? ld->ld_defhost : ludp->lud_host )) == NULL ) {
@@ -288,22 +288,13 @@ ldap_url_search( LDAP *ld, LDAP_CONST char *url, int attrsonly )
                                srv->lsrv_port = ludp->lud_port;
                        }
                }
-#else /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
-               ld->ld_errno = LDAP_LOCAL_ERROR;
-               err = -1;
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
        }
 
        if ( err != 0 ) {
                ber_free( ber, 1 );
        } else {
-#ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS
                err = ldap_send_server_request( ld, ber, ld->ld_msgid, NULL, srv,
                    NULL, 1 );
-#else /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
-               err = ldap_send_initial_request( ld, LDAP_REQ_SEARCH,
-                   ludp->lud_dn, ber );
-#endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_REFERRALS */
        }
 
        ldap_free_urldesc( ludp );