tevent: add tevent_req_set_cleanup_fn()
authorStefan Metzmacher <metze@samba.org>
Fri, 27 Sep 2013 00:29:57 +0000 (02:29 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 17 Jan 2014 11:38:08 +0000 (12:38 +0100)
Note that some callers used their own destructor for their
tevent_req instance, they'll just overwrite this,
which is not intended, but works without problems.

The intended way is to specify a cleanup function
and handle the TEVENT_REQ_RECEIVED state as destructor.

Note that the TEVENT_REQ_RECEIVED cleanup event might
be triggered by an explicit tevent_req_received()
in the _recv() function. The TEVENT_REQ_RECEIVED event
is only triggered once as tevent_req_received()
will remove the destructor.

So the difference compared to a custom destructor
is that the struct tevent_req itself can continue
to be there, while tevent_req_received() removed
all internal state.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

No differences found