diff options
-rw-r--r-- | radsecproxy.c | 14 | ||||
-rw-r--r-- | radsecproxy.h | 2 |
2 files changed, 7 insertions, 9 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; diff --git a/radsecproxy.h b/radsecproxy.h index 476011c..a8326cb 100644 --- a/radsecproxy.h +++ b/radsecproxy.h @@ -109,7 +109,7 @@ struct server { pthread_t clientth; struct timeval lastconnecttry; uint8_t connectionok; - uint8_t loststatsrv; + uint8_t lostrqs; int nextid; struct request *requests; uint8_t newrq; |