[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
patch to back-perl
Hi all, I have added some functionality to back-perl, and I thought its
about time I sent you the patch. It does two things
- Passes the numeric connection id along to all operational methods
(bind, search, etc) of the perl backend. This makes back-perl much more
useful because it can maintian connection state, and deal with
authenticated connections. The connection id now comes as the first
argument after the object reference in all the operational methods.
- Changes the way searches are dealt with so they can be done asyncronisly.
the current api for searches is
search ($self, $connid, $base, $scope, $alias_pol, $s_limit, $t_limit,
$filter, $attronly, @attrs)
where this method returnes an array of entries found along with the
return code
the one I propose is
search ($self, $connid, $base, $scope, $alias_pol, $s_limit, $t_limit,
$filter, $attronly, @attrs)
where this returnes nothing
search_done($self)
where this returnes 1 if there are no more entries and 0 if there are
search_get_next($self)
This returnes the next entry (only one)
search_get_returncode($self)
This is called only after search_done returns 1, it returns the return code.
the basic calling structure is (note this is not the actual code, its
JUST a model)
while(! obj->search_done) {
send_search_entry(str2entry(obj->search_get_next)))
}
send_ldap_result(obj->search_get_returncode)
Note: this obviously changes the API for searches in a big way (and
everything else in a small way), that's one of the reasons I've been
sitting on it for many months not saying anything :-)
The performance gain from doing it this way is quite large for big
searches. I implimented this because I'm using a perl back-end for an
ldap proxying solution (which unfortunatly has to do more than back-meta
can do), and we needed to be able to throw large searches at it. Anyway,
if you like it, good, if you hate it, flame :-P
Eric Stokes
eric.stokes@csun.edu
Attachment:
back-perl-connid-asyncsearch.patch.gz
Description: Unix tar archive