On Friday 17 September 2010 19:56:15 Stephen Gallagher wrote:
On 09/17/2010 12:16 PM, Ralf Haferkamp wrote:
> Find a new version attached. Does that look better? If that is not
> what you were referring to lets discuss it in IRC on monday.
>
> Note, I needed to implement sdap_process_group_send() slightly
> differnent than the other _send functions in sdap_async_accounts().
> Instead of returning as tevent_req* it does return a error code.
> The tevent_req* is returned via the argument list. I did this
> because there are cases where sdap_process_group_send() does not
> need to create a new tevent_req*, e.g. when the groups doesn't have
> any members or when all groupmembers are already cached.
In situations like this, the correct behavior is still to return the
request, but inside the _send() function call:
tevent_req_done(req);
tevent_req_post(req, ev);
return req;
This way it will just call the finish handler immediately after the
parent function returns. Then you don't need to have separate
codepaths for functions that do or do not have to make subrequests.
Nice, that
makes the code a little cleaner, thanks. New patches attached.
--
Ralf