struct tevent_context *ev,
struct timeval endtime);
-void tevent_req_done(struct tevent_req *req);
-
-bool tevent_req_error(struct tevent_req *req,
- uint64_t error);
-
-bool tevent_req_nomem(const void *p,
- struct tevent_req *req);
+void _tevent_req_done(struct tevent_req *req,
+ const char *location);
+#define tevent_req_done(req) \
+ _tevent_req_done(req, __location__)
+
+bool _tevent_req_error(struct tevent_req *req,
+ uint64_t error,
+ const char *location);
+#define tevent_req_error(req, error) \
+ _tevent_req_error(req, error, __location__)
+
+bool _tevent_req_nomem(const void *p,
+ struct tevent_req *req,
+ const char *location);
+#define tevent_req_nomem(p, req) \
+ _tevent_req_nomem(p, req, __location__)
struct tevent_req *tevent_req_post(struct tevent_req *req,
struct tevent_context *ev);
return talloc_asprintf(mem_ctx,
"tevent_req[%p/%s]: state[%d] error[%lld (0x%llX)] "
" state[%s (%p)] timer[%p]",
- req, req->internal.location,
+ req, req->internal.create_location,
req->internal.state,
(unsigned long long)req->internal.error,
(unsigned long long)req->internal.error,
return NULL;
}
req->internal.private_type = type;
- req->internal.location = location;
+ req->internal.create_location = location;
+ req->internal.finish_location = NULL;
req->internal.state = TEVENT_REQ_IN_PROGRESS;
req->internal.trigger = tevent_create_immediate(req);
if (!req->internal.trigger) {
return req;
}
-static void tevent_req_finish(struct tevent_req *req, enum tevent_req_state state)
+static void tevent_req_finish(struct tevent_req *req,
+ enum tevent_req_state state,
+ const char *location)
{
req->internal.state = state;
+ req->internal.finish_location = location;
if (req->async.fn != NULL) {
req->async.fn(req);
}
* function.
*/
-void tevent_req_done(struct tevent_req *req)
+void _tevent_req_done(struct tevent_req *req,
+ const char *location)
{
- tevent_req_finish(req, TEVENT_REQ_DONE);
+ tevent_req_finish(req, TEVENT_REQ_DONE, location);
}
/**
* \endcode
*/
-bool tevent_req_error(struct tevent_req *req, uint64_t error)
+bool _tevent_req_error(struct tevent_req *req,
+ uint64_t error,
+ const char *location)
{
if (error == 0) {
return false;
}
req->internal.error = error;
- tevent_req_finish(req, TEVENT_REQ_USER_ERROR);
+ tevent_req_finish(req, TEVENT_REQ_USER_ERROR, location);
return true;
}
* \endcode
*/
-bool tevent_req_nomem(const void *p, struct tevent_req *req)
+bool _tevent_req_nomem(const void *p,
+ struct tevent_req *req,
+ const char *location)
{
if (p != NULL) {
return false;
}
- tevent_req_finish(req, TEVENT_REQ_NO_MEMORY);
+ tevent_req_finish(req, TEVENT_REQ_NO_MEMORY, location);
return true;
}
struct tevent_req *req = talloc_get_type(private_data,
struct tevent_req);
- tevent_req_finish(req, req->internal.state);
+ tevent_req_finish(req, req->internal.state,
+ req->internal.finish_location);
}
/**
TALLOC_FREE(req->internal.timer);
- tevent_req_finish(req, TEVENT_REQ_TIMED_OUT);
+ tevent_req_finish(req, TEVENT_REQ_TIMED_OUT, __FUNCTION__);
}
bool tevent_req_set_endtime(struct tevent_req *req,