[Date Prev][Date Next] [Chronological] [Thread] [Top]

FW: commit: ldap/libraries/libldap getattr.c getdn.c getvalues.c



I noticed while debugging a session that ldapsearch (or rather,
ldap_get_values and ldap_get_values_len) always start from the beginning of
the LDAPMessage when locating the values for a specified attribute. This was
a little annoying when I was debugging large I/O operations. That was the
motivation for these new functions, which simply scan forward from where they
left off in the BerElement. (They're little more than glorified wrappers for
ber_scanf, really.) I've added an example of their use in ldap_search.c,
deselected behind a #if 1/#else/#endif block. I don't know that the
ldapsearch commandline tool's efficiency is such a critical issue, but it's
worth considering for back-ldap and proxy servers in general. (Of course I
parsed the BerElement myself in back-ldap, mainly to avoid the inefficiency
in ldap_get_values.) If this is a bad idea, or maybe belongs in ldap_pvt, we
can remove or move them. At present I think it's interesting but not of
critical value. I just wanted to get it out of my local tree before I got too
far out of date...

  -- Howard Chu
  Chief Architect, Symas Corp.       Director, Highland Sun
  http://www.symas.com               http://highlandsun.com/hyc
  Symas: Premier OpenSource Development and Support

-----Original Message-----
From: owner-openldap-commit@OpenLDAP.org
[mailto:owner-openldap-commit@OpenLDAP.org]On Behalf Of hyc@OpenLDAP.org
Sent: Thursday, September 05, 2002 2:34 AM
To: OpenLDAP Commit
Subject: commit: ldap/libraries/libldap getattr.c getdn.c getvalues.c


Update of /repo/OpenLDAP/pkg/ldap/libraries/libldap

Modified Files:
	getattr.c  1.26 -> 1.27
	getdn.c  1.106 -> 1.107
	getvalues.c  1.17 -> 1.18

Log Message:
Added new ldap_get_{dn,attribute,values}_ber functions for linearly
processing a search entry. Avoids O(n^2) ldap_get_values() behavior.


CVS Web URLs:
  http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/
    http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/getattr.c
    http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/getdn.c
    http://www.openldap.org/devel/cvsweb.cgi/libraries/libldap/getvalues.c

Changes are generally available on cvs.openldap.org (and CVSweb)
within 30 minutes of being committed.