Fallback home_servers MUST be virtual_servers.
authoraland <aland>
Wed, 14 May 2008 03:08:39 +0000 (03:08 +0000)
committeraland <aland>
Wed, 14 May 2008 03:08:39 +0000 (03:08 +0000)
Don't check home_server->state when looking for fallback
servers.  They're virtual, and thus always alive.

src/main/realms.c

index 2e51e91..4863d5d 100644 (file)
@@ -684,6 +684,10 @@ static int server_pool_add(realm_config_t *rc,
        pool->cs = cs;
 
 
+       /*
+        *      Fallback servers must be defined, and must be
+        *      virtual servers.
+        */
        cp = cf_pair_find(cs, "fallback");
        if (cp) {
                if (!pool_check_home_server(rc, cp, cf_pair_value(cp),
@@ -691,6 +695,11 @@ static int server_pool_add(realm_config_t *rc,
                        
                        goto error;
                }
+
+               if (!pool->fallback->server) {
+                       cf_log_err(cs, "Fallback home_server %s does NOT contain a virtual_server directive.", pool->fallback->name);
+                       goto error;
+               }
        }
 
        if (do_print) cf_log_info(cs, " home_server_pool %s {", name2);
@@ -1698,8 +1707,7 @@ home_server *home_server_ldb(const char *realmname,
        /*
         *      There's a fallback if they're all dead.
         */
-       if (pool->fallback &&
-           (pool->fallback->state == HOME_STATE_ALIVE)) {
+       if (pool->fallback) {
                return pool->fallback;
        }