summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_req.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-04 17:26:23 +0200
committerVolker Lendecke <vl@samba.org>2009-06-04 17:29:48 +0200
commitc6f39b46a7b0505331612a1bee15a82f97009f0d (patch)
tree1152329406cbe29522de74326a28e434eef64233 /lib/tevent/tevent_req.c
parent9dad0536d6e91cb993edd636f7659d2351d98000 (diff)
downloadsamba-c6f39b46a7b0505331612a1bee15a82f97009f0d.tar.gz
samba-c6f39b46a7b0505331612a1bee15a82f97009f0d.tar.bz2
samba-c6f39b46a7b0505331612a1bee15a82f97009f0d.zip
Add tevent_req_notify_callback
This is necessary for requests that have multiple results. Examples would be SMBEcho and ldap_search.
Diffstat (limited to 'lib/tevent/tevent_req.c')
-rw-r--r--lib/tevent/tevent_req.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/tevent/tevent_req.c b/lib/tevent/tevent_req.c
index 01700006eb..541f93f99c 100644
--- a/lib/tevent/tevent_req.c
+++ b/lib/tevent/tevent_req.c
@@ -117,17 +117,22 @@ struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
return req;
}
-static void tevent_req_finish(struct tevent_req *req,
- enum tevent_req_state state,
- const char *location)
+void _tevent_req_notify_callback(struct tevent_req *req, const char *location)
{
- req->internal.state = state;
req->internal.finish_location = location;
if (req->async.fn != NULL) {
req->async.fn(req);
}
}
+static void tevent_req_finish(struct tevent_req *req,
+ enum tevent_req_state state,
+ const char *location)
+{
+ req->internal.state = state;
+ _tevent_req_notify_callback(req, location);
+}
+
/**
* @brief An async request has successfully finished
* @param[in] req The finished request