[PATCH] messaging3 improvements
Stefan (metze) Metzmacher
metze at samba.org
Wed May 7 15:16:03 MDT 2014
Hi Jeremy,
>>> /*
>>> * Just set the [new_]waiters entry to NULL, be careful not to mess
>>> * with the other "waiters" array contents. We are often called from
>>> @@ -562,6 +571,13 @@ static void messaging_filtered_read_done(struct tevent_req *req,
>>> if (tevent_req_nomem(state->rec, req)) {
>>> return;
>>> }
>>> +
>>> + /*
>>> + * We have to defer the callback here, as we might be called from
>>> + * within a different tevent_context than state->ev
>>> + */
>>> + tevent_req_defer_callback(req, state->ev);
>>> +
>>> tevent_req_done(req);
>>> }
>>
>> tevent_req_defer_callback() should to be called directly after
>> tevent_req_create() in this case. This is important for
>> error cases which are handled by tevent_req_nomem() or tevent_req_error().
>>
>> With this aspect fixed you have my review for the whole patchset.
>
> So just to confirm, you're happy with the attached ?
Yes, the tevent_req_defer_callback() is correct now.
But I just noticed that messaging_defer_callback_trigger() doesn't
cleanup 'state'.
And it would be nice to use a helper variable in poll_funcs_fde_handler()
instead of passing poll_events_to_tevent() as argument to w->callback().
metze
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 263 bytes
Desc: OpenPGP digital signature
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20140507/470a8ae8/attachment.pgp>
More information about the samba-technical
mailing list