summaryrefslogtreecommitdiffstats
path: root/src/providers
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/fail_over.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/providers/fail_over.c b/src/providers/fail_over.c
index 002d6d578..7fed7cce1 100644
--- a/src/providers/fail_over.c
+++ b/src/providers/fail_over.c
@@ -75,7 +75,7 @@ struct fo_server {
bool primary;
void *user_data;
int port;
- int port_status;
+ enum port_status port_status;
struct srv_data *srv_data;
struct fo_service *service;
struct timeval last_status_change;
@@ -686,12 +686,16 @@ get_first_server_entity(struct fo_service *service, struct fo_server **_server)
* Otherwise iterate through the server list.
*/
-
/* First, try primary servers after the last one we tried.
* (only if the last one was primary as well)
*/
if (service->last_tried_server != NULL &&
service->last_tried_server->primary) {
+ if (service->last_tried_server->port_status == PORT_NEUTRAL) {
+ server = service->last_tried_server;
+ goto done;
+ }
+
DLIST_FOR_EACH(server, service->last_tried_server->next) {
/* Go only through primary servers */
if (!server->primary) continue;