summaryrefslogtreecommitdiff
path: root/accel-pptpd/radius/req.c
diff options
context:
space:
mode:
Diffstat (limited to 'accel-pptpd/radius/req.c')
-rw-r--r--accel-pptpd/radius/req.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/accel-pptpd/radius/req.c b/accel-pptpd/radius/req.c
index f3f41386..5b1261fe 100644
--- a/accel-pptpd/radius/req.c
+++ b/accel-pptpd/radius/req.c
@@ -196,8 +196,22 @@ static void req_wakeup(struct rad_req_t *req)
static int rad_req_read(struct triton_md_handler_t *h)
{
struct rad_req_t *req = container_of(h, typeof(*req), hnd);
+ struct rad_packet_t *pack;
+ int r;
+
+ while (1) {
+ r = rad_packet_recv(h->fd, &pack, NULL);
+
+ if (pack) {
+ if (req->reply)
+ rad_packet_free(req->reply);
+ req->reply = pack;
+ }
+
+ if (r)
+ break;
+ }
- req->reply = rad_packet_recv(h->fd, NULL);
req_wakeup(req);
return 0;