1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

28 Commits

Author SHA1 Message Date
Stefan Metzmacher
0ed93e099a tevent: add/use tevent_req_destructor
This makes sure we call tevent_req_received(req) on talloc_free()
and cleanup things in a defined order.

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.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-01-17 12:38:08 +01:00
Stefan Metzmacher
99910b67d2 tevent: make use of talloc_get_type_abort() in tevent_req.c
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-11 22:46:09 +01:00
Stefan Metzmacher
7a97d4c4c3 tevent: tevent_req_create() already uses ZERO_STRUCT(req)
There's no need to zero individual members.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-11 22:46:09 +01:00
Stefan Metzmacher
39888fd4a3 tevent: let tevent_req_received() clear the private_cancel function
This makes sure it's not called when the private state is already gone.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-11 22:46:09 +01:00
Stefan Metzmacher
577afba8b3 tevent: cancel the timeout timer when the request is finished
As we might defer the callback with tevent_req_defer_callback()
when calling tevent_req_done(), we should cancel the timeout directly.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-12-11 22:46:09 +01:00
Volker Lendecke
8f4069c7cd tevent: Use talloc_pooled_object for tevent_req_create
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Sep  8 13:39:25 CEST 2013 on sn-devel-104
2013-09-08 13:39:25 +02:00
Stefan Metzmacher
e5827a4007 tevent: add tevent_req_defer_callback()
metze
2011-07-09 11:02:42 +02:00
Volker Lendecke
c2a826b10c tevent: Add tevent_req_oom
This is a replacement for tevent_req_nomem(NULL, req)
2011-06-20 12:33:24 +02:00
Andreas Schneider
4263983cad tevent: Added basic doxygen documentation. 2010-05-05 09:28:04 +02:00
Brad Hards
119a8230eb Spelling fixes for tevent.
Signed-off-by: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
2010-02-22 21:45:32 +01:00
Stefan Metzmacher
45e4be0d96 tevent: add tevent_req_cancel() infrastructure
This offers a generic way for callers to cancel an
async request.

metze
2009-08-17 09:25:44 +02:00
Stefan Metzmacher
95c3d3b5d8 tevent: add some more doxygen comments for tevent_req functions
metze
2009-08-15 10:46:36 +02:00
Jeremy Allison
5927ca7067 Change to talloc_zero_size instead of extra memset.
Jeremy.
2009-07-14 16:54:01 -07:00
Jeremy Allison
7be1d727a3 When tallocing a memory block for the state in a tevent_req struct,
ensure it's zeroed out. Vl & Metze please check.
Jeremy.
2009-07-14 16:42:21 -07:00
Volker Lendecke
c6f39b46a7 Add tevent_req_notify_callback
This is necessary for requests that have multiple results. Examples would be
SMBEcho and ldap_search.
2009-06-04 17:29:48 +02:00
Stefan Metzmacher
6f7cd213dd tevent: fix typo async_req_done() => tevent_req_done()
metze
2009-05-07 08:09:56 +02:00
Stefan Metzmacher
9eaf53d98e tevent: store the location where a request was finished
This is very useful to find bugs.
You can use 'p *req' in gdb to show where
tevent_req_done(), tevent_req_error() or tevent_req_nomem()
was called.

metze
2009-03-17 20:17:01 +01:00
Stefan Metzmacher
4bdf299385 tevent: use an immediate event fot tevent_req_post()
Now tevent_req_post() never fails

metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
a78cd2a24b tevent: use TALLOC_FREE() in tevent_req.c
metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
09d1b2324c tevent: add tevent_req_received() function
This function can be called as last action of a _recv()
function, it destroys the data attached to the tevent_req.

metze
2009-03-10 16:44:44 +01:00
Simo Sorce
67d41d0fc7 Make struct tevent_req opaque
Move struct tevent_req in tevent_internal, and ad getters and setters
for private data and the callback function.
This patch also renames 'private_state' into 'data'. What is held in this
pointer is in fact data and not a state like enum tevent_req_state.
Calling it 'state' is confusing.

The functions addedd are:
tevent_req_set_callback() - sets req->async.fn and req->async.private_data
tevent_req_set_print_fn() - sets req->private_print
tevent_req_callback_data() - gets req->async.private_data
tevent_req_data() - gets rea->data

This way it is much simpler to keep API/ABI compatibility in the future.
2009-03-02 11:02:09 -05:00
Stefan Metzmacher
e2f37ec106 tevent: add private_print function feature to tevent_req
metze
2009-02-25 14:30:55 +01:00
Stefan Metzmacher
13ac0dc456 tevent: add tevent_req_poll() function
metze
2009-02-25 14:08:36 +01:00
Stefan Metzmacher
7f6618a3de tevent: rename tevent_req_set_timeout() => tevent_req_set_endtime()
This makes more clear what the function does.

metze
2009-02-18 10:31:35 +01:00
Kai Blin
48b874e376 tevent: Rename ev_timeval* functions to tevent_timeval, export them.
Also add tevent_timeval_add() and tevent_timeval_current_ofs()
to help not depending on lub/util/time.c for things that just need tevent
2009-02-17 09:19:31 +01:00
Stefan Metzmacher
6211162d3e lib/tevent: change to LGPLv3+
metze
2009-02-16 08:53:25 +01:00
Stefan Metzmacher
113651c517 lib/tevent: add tevent_req infrastructure
This is almost a copy of the async_req code,
which will be removed later.

metze
2009-02-13 18:37:01 +01:00
Stefan Metzmacher
f337974ed5 lib/tevent: add tevent_req.c as copy of lib/async_req/async_req.c
metze
2009-02-13 16:02:14 +01:00