Skip to content

Commit

Permalink
xlat for home server pool state
Browse files Browse the repository at this point in the history
  • Loading branch information
alandekok committed Mar 10, 2016
1 parent 48e8b9f commit a4ed7bc
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/realms.c
Expand Up @@ -274,6 +274,20 @@ static ssize_t xlat_server_pool(char **out, size_t outlen,
return 0;
}

if (strcmp(fmt, "state") == 0) {
char const *state;

if (request->home_pool->in_fallback) {
state = "fallback";

} else {
state = "alive";
}

strlcpy(*out, state, outlen);
return strlen(*out);
}

return xlat_cs(request->home_pool->cs, fmt, *out, outlen);
}
#endif
Expand Down

0 comments on commit a4ed7bc

Please sign in to comment.