From c8708cd958c633cc3c57a3460bdb15391200e1e1 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Fri, 19 Nov 2010 21:11:26 +0100 Subject: Run checks before resetting offline state Before setting the backend to online during a reset offline request the check_online method if the ID provider is called. If the check_online method returns that the ID provider is still not reachable the backend stays offline. Otherwise the backend is switched to online and the related callbacks are run. Additionally the check online test is called during the res_init request because a change in /etc/resolve.conf might also make a server reachable which was assumed offline before. --- src/providers/dp_backend.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/providers/dp_backend.h') diff --git a/src/providers/dp_backend.h b/src/providers/dp_backend.h index e11b3b6c..3d5e40ba 100644 --- a/src/providers/dp_backend.h +++ b/src/providers/dp_backend.h @@ -111,6 +111,8 @@ struct be_ctx { struct loaded_be loaded_be[BET_MAX]; struct bet_info bet_info[BET_MAX]; + + size_t check_online_ref_count; }; struct bet_ops { @@ -193,4 +195,5 @@ void be_fo_try_next_server(struct be_ctx *ctx, const char *service_name); int be_fo_run_callbacks_at_next_request(struct be_ctx *ctx, const char *service_name); +void reset_fo(struct be_ctx *be_ctx); #endif /* __DP_BACKEND_H___ */ -- cgit