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

Re: (ITS#4314) C API for paged results

On Sun, 2006-01-08 at 20:47 +0100, Hans Leidekker wrote:
> On Sunday 08 January 2006 19:12, Pierangelo Masarati wrote:
> > So I think your API is fine for consistency with other controls, but I'd
> > prefer to split it in two levels:
> Sure, I can split things up like that.

It's ok, I've already split things (as I was doing the same for vlv,
sort & so).

> > On a related note, the cookie is supposed to be __empty__ as per RFC
> > 2696 either when sent the first time or when returned the last time, so
> > I don't see any reason to have ldap_parse_page_control() pass a "struct
> > berval **" for it, since that implies that also the "struct berval" has
> > to be malloc()'ed; simply pass a "struct berval *" and make the function
> > set bv_len = 0 when the cookie is empty.
> Good point. On the other hand, others have set the trend already:
>  http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ldap/ldap/ldap_parse_page_control.asp
>  http://www-03.ibm.com/servers/eserver/iseries/ldap/ldap_parse_page_control.htm
> If we do deviate from those examples I think we should also change the
> "const char" parameter for specifying criticality into an "int", for
> consistency with ldap_create_sort_control() and ldap_create_control().

I see.  For create, I'd prefer to stick with the convention of existing
functions, although the ldctl_iscritical is actually a char so the
existing convention is a bit irrational; in any case, I'm positive it's
not going to bring in too much inconsistency, since automatic cast from
char to int and viceversa should work relatively fine.

For parse functions, there wouldn't be any issue: we can keep the
consolidated form as is, and use ldap_parse_pageresult_control() for our
API.  I'm about to commit a rewiewed version of your patch and of the
related cleanup of existing controls which follows Kurt's changes.


Ing. Pierangelo Masarati
Responsabile Open Solution
OpenLDAP Core Team

SysNet s.n.c.
Via Dossi, 8 - 27100 Pavia - ITALIA
Office:   +39.02.23998309          
Mobile:   +39.333.4963172
Email:    pierangelo.masarati@sys-net.it