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/fail_over.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/providers/fail_over.c') diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c index 9b818d0c4..858d6ba6a 100644 --- a/src/providers/fail_over.c +++ b/src/providers/fail_over.c @@ -1329,3 +1329,20 @@ fo_get_server_hostent(struct fo_server *server) } return server->common->hostent; } + +void fo_reset_services(struct fo_ctx *fo_ctx) +{ + struct fo_service *service; + struct fo_server *server; + + DLIST_FOR_EACH(service, fo_ctx->service_list) { + DLIST_FOR_EACH(server, service->server_list) { + fo_set_server_status(server, SERVER_NAME_NOT_RESOLVED); + fo_set_port_status(server, PORT_NEUTRAL); + if (server->srv_data != NULL) { + set_srv_data_status(server->srv_data, SRV_NOT_RESOLVED); + } + } + } +} + -- cgit