提交 a8a0d01b 编写于 作者: D Dmitry Kozlov

radius: properly handle send failures

Signed-off-by: NDmitry Kozlov <xeb@mail.ru>
上级 40311e78
......@@ -264,12 +264,14 @@ int rad_acct_start(struct radius_pd_t *rpd)
if (conf_acct_delay_time) {
time(&ts);
rad_packet_change_int(rpd->acct_req->pack, NULL, "Acct-Delay-Time", ts - rpd->acct_timestamp);
if (req_set_RA(rpd->acct_req, rpd->acct_req->serv->secret))
if (req_set_RA(rpd->acct_req, rpd->acct_req->serv->secret)) {
rad_server_req_exit(rpd->acct_req);
goto out_err;
}
}
if (rad_req_send(rpd->acct_req, conf_verbose))
goto out_err;
goto out;
__sync_add_and_fetch(&rpd->acct_req->serv->stat_acct_sent, 1);
......@@ -300,6 +302,7 @@ int rad_acct_start(struct radius_pd_t *rpd)
break;
}
out:
rad_server_req_exit(rpd->acct_req);
if (rpd->acct_req->reply)
......@@ -414,7 +417,7 @@ void rad_acct_stop(struct radius_pd_t *rpd)
break;
}
if (rad_req_send(rpd->acct_req, conf_verbose))
break;
goto out;
__sync_add_and_fetch(&rpd->acct_req->serv->stat_acct_sent, 1);
rad_req_wait(rpd->acct_req, conf_timeout);
if (!rpd->acct_req->reply) {
......@@ -439,6 +442,7 @@ void rad_acct_stop(struct radius_pd_t *rpd)
break;
}
out:
rad_server_req_exit(rpd->acct_req);
if (rpd->acct_req->reply)
......
......@@ -193,7 +193,7 @@ static int rad_auth_send(struct rad_req_t *req)
stat_accm_add(req->serv->stat_auth_lost_5m, 1);
}
}
out:
rad_server_req_exit(req);
if (!req->reply) {
......@@ -212,7 +212,6 @@ static int rad_auth_send(struct rad_req_t *req)
}
}
out:
return PWDB_DENIED;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册