diff options
author | venaas <venaas> | 2008-06-10 08:53:59 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-06-10 08:53:59 +0000 |
commit | be653ec1827a47e129fd656312cffb109e87aad8 (patch) | |
tree | 201d6c074532bdafd10b1d2b9d1cd9201831314f /radsecproxy.c | |
parent | 49e80a5157d2887d6cea9ccca887d3a15da5de6e (diff) |
failover also when not using status server
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@288 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r-- | radsecproxy.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 30cc0f1..4aa52e3 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -1808,13 +1808,13 @@ struct server *chooseserver(struct list *srvconfs) { first = server; if (!server->connectionok) continue; - if (!server->loststatsrv) + if (!server->lostrqs) return server; if (!best) { best = server; continue; } - if (server->loststatsrv < best->loststatsrv) + if (server->lostrqs < best->lostrqs) best = server; } return best ? best : first; @@ -1960,7 +1960,7 @@ int replyh(struct server *server, unsigned char *buf) { char tmp[760], stationid[760]; server->connectionok = 1; - server->loststatsrv = 0; + server->lostrqs = 0; i = buf[1]; /* i is the id */ @@ -2240,11 +2240,9 @@ void *clientwr(void *arg) { if (rq->tries == (*rq->buf == RAD_Status_Server || server->conf->type == 'T' ? 1 : REQUEST_RETRIES)) { debug(DBG_DBG, "clientwr: removing expired packet from queue"); - if (*rq->buf == RAD_Status_Server) { - debug(DBG_WARN, "clientwr: no status server response, %s dead?", server->conf->host); - if (server->loststatsrv < 255) - server->loststatsrv++; - } + debug(DBG_WARN, "clientwr: no server response, %s dead?", server->conf->host); + if (server->lostrqs < 255) + server->lostrqs++; freerqdata(rq); /* setting this to NULL means that it can be reused */ rq->buf = NULL; |