From dd025b4cbd501e2f34461f9d8359a829b81f5c2f Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 27 Apr 2010 14:57:37 -0400 Subject: Add callback when the ID provider switches from offline to online Allow backends to set a callback in the be_ctx that should be invoked when the ID provider goes online. This can be used to perform regular maintenance tasks that are valid only when going online. --- src/providers/ldap/sdap_async_connection.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/providers/ldap/sdap_async_connection.c') diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index 17cd55863..bd8d4e960 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -813,6 +813,7 @@ struct sdap_cli_connect_state { struct tevent_context *ev; struct sdap_options *opts; struct sdap_service *service; + struct be_ctx *be; bool use_rootdse; struct sysdb_attrs *rootdse; @@ -851,6 +852,7 @@ struct tevent_req *sdap_cli_connect_send(TALLOC_CTX *memctx, state->service = service; state->be = be; state->srv = NULL; + state->be = be; if (rootdse) { state->use_rootdse = true; @@ -1123,6 +1125,8 @@ static void sdap_cli_auth_done(struct tevent_req *subreq) { struct tevent_req *req = tevent_req_callback_data(subreq, struct tevent_req); + struct sdap_cli_connect_state *state = tevent_req_data(req, + struct sdap_cli_connect_state); enum sdap_result result; int ret; @@ -1137,6 +1141,11 @@ static void sdap_cli_auth_done(struct tevent_req *subreq) return; } + /* Reconnection succeeded + * Run any post-connection routines + */ + be_run_online_cb(state->be); + tevent_req_done(req); } -- cgit