From bbd33e46aa6194c1086939f7cf8538c067186455 Mon Sep 17 00:00:00 2001 From: Jan Zeleny Date: Mon, 4 Jun 2012 12:06:53 -0400 Subject: Primary server support: basic support in failover code Now there are two list of servers for each service. If currently selected server is only backup, then an event will be scheduled which tries to get connection to one of primary servers and if it succeeds, it starts using this server instead of the one which is currently connected to. --- src/providers/fail_over.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/providers/fail_over.h') diff --git a/src/providers/fail_over.h b/src/providers/fail_over.h index 8fbbe251..b69e8a53 100644 --- a/src/providers/fail_over.h +++ b/src/providers/fail_over.h @@ -116,9 +116,8 @@ int fo_get_server_count(struct fo_service *service); * connection. If 'name' is NULL, no server resolution will be done. */ int fo_add_server(struct fo_service *service, - const char *name, - int port, - void *user_data); + const char *name, int port, + void *user_data, bool primary); int fo_add_srv_server(struct fo_service *service, @@ -180,6 +179,8 @@ const char *fo_get_server_str_name(struct fo_server *server); struct resolv_hostent *fo_get_server_hostent(struct fo_server *server); +bool fo_is_server_primary(struct fo_server *server); + time_t fo_get_server_hostname_last_change(struct fo_server *server); int fo_is_srv_lookup(struct fo_server *s); -- cgit