[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
how to use ldap_parse_sortresponse_control
- To: openldap-technical@openldap.org
- Subject: how to use ldap_parse_sortresponse_control
- From: owen nirvana <freeespeech@gmail.com>
- Date: Wed, 13 Apr 2011 08:58:38 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:from:date:message-id:subject:to :content-type; bh=wkqwVGJhBI2pGcq9b0qk5G0BttooDwbVVtZTx+dGNM0=; b=fRAVUzkiCi8tHTul2T3UQr7PQSfv/0+pi4D1MFPi1LBYEcs2/IJ5IJx7C2DyHzapim xyyiWdHKFlgksGvDrKaArI44Sr3Z7ArnpBu7xRL7x+QVEbOWcN9hJpz6ffyNUnKOC6v+ 43Vpsb1qzCrFTDbYiXq6l82b18XHBQd1qvLUk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type; b=YPBSzWszpy4EzOYbFvDoDPQv2DwQpNK4U5vR0AK7CDW4abVPpsii5DlegzahWXDKgc tFEHwYus8BxUdOrNsOOffIeUULWZqhHdeWLZ4X+xt1P3bbl4N2MP3bz1ayNMkHVQBpJF 5lMeC9lZEFtRGkqemS2OjXx7/DZkYDYy9NoQs=
I confuse with the use of ldap_parse_sortresponse_control because there is no example and document about it. Although it seems like ldap_parse_sort_control of Novell CLDAP and Mozilla C LDAP, it is wrong if using it on their way.
the following is my code:
...
LDAPControl *sortctrl = NULL;
LDAPControl *serverctrls[2];
LDAPControl **resultctrls = NULL;
LDAPSortKey **sortkeylist;
...
ldap_create_sort_keylist(&sortkeylist, sort_attrs);
/* Create the sort control. */
rc = ldap_create_sort_control(ldap, sortkeylist, 1, &sortctrl);
...
requestctrls[0] = sortctrl;
requestctrls[1] = NULL;
/* Search for all entries in Sunnyvale */
rc = ldap_search_ext_s(...);
...
parse_rc =
ldap_parse_result(ldap, result, &rc, NULL, NULL, NULL, &resultctrls, 0);
...
parse_rc = ldap_parse_sortresponse_control(ldap, *resultctrls, &rcode, NULL);
...
for (...) {
...
}
nothing is searched. it is ok if no sort or sort by CLDAP
gtalk:freeespeech@gmail.com