Lines Matching refs:rqout

96 void freerqoutdata(struct rqout *rqout);
241 struct rqout *rqout; in removeclientrq() local
249 rqout = rq->to->requests + rq->newid; in removeclientrq()
250 pthread_mutex_lock(rqout->lock); in removeclientrq()
251 if (rqout->rq == rq) /* still pointing to our request */ in removeclientrq()
252 freerqoutdata(rqout); in removeclientrq()
253 pthread_mutex_unlock(rqout->lock); in removeclientrq()
294 struct rqout *rqout, *end; in freeserver() local
301 rqout = server->requests; in freeserver()
302 for (end = rqout + MAX_REQUESTS; rqout < end; rqout++) { in freeserver()
303 freerqoutdata(rqout); in freeserver()
304 pthread_mutex_destroy(rqout->lock); in freeserver()
305 free(rqout->lock); in freeserver()
343 conf->servers->requests = calloc(MAX_REQUESTS, sizeof(struct rqout)); in addserver()
428 void freerqoutdata(struct rqout *rqout) { in freerqoutdata() argument
429 if (!rqout) in freerqoutdata()
431 if (rqout->rq) { in freerqoutdata()
432 if (rqout->rq->buf) { in freerqoutdata()
433 free(rqout->rq->buf); in freerqoutdata()
434 rqout->rq->buf = NULL; in freerqoutdata()
436 rqout->rq->to = NULL; in freerqoutdata()
437 freerq(rqout->rq); in freerqoutdata()
438 rqout->rq = NULL; in freerqoutdata()
440 rqout->tries = 0; in freerqoutdata()
441 memset(&rqout->expiry, 0, sizeof(struct timeval)); in freerqoutdata()
1389 struct rqout *rqout; in replyh() local
1399 rqout = server->requests + buf[1]; in replyh()
1400 pthread_mutex_lock(rqout->lock); in replyh()
1401 if (!rqout->tries) { in replyh()
1408 msg = buf2radmsg(buf, server->conf->secret, server->conf->secret_len, rqout->rq->msg->auth); in replyh()
1427 if (rqout->rq->msg->code == RAD_Status_Server) { in replyh()
1428 freerqoutdata(rqout); in replyh()
1448 from = rqout->rq->from; in replyh()
1464rqout->rq, server->conf->secret, server->conf->secret_len, from->conf->secret, from->conf->secret_… in replyh()
1466rqout->rq, server->conf->secret, server->conf->secret_len, from->conf->secret, from->conf->secret_… in replyh()
1483 rqout->rq->msg->auth, rqout->rq->rqauth, attr->v+1, 2, newsalt, 2)) in replyh()
1488 replylog(msg, server, rqout->rq); in replyh()
1492 fticks_log(&options, from, msg, rqout->rq); in replyh()
1494 msg->id = (char)rqout->rq->rqid; in replyh()
1495 memcpy(msg->auth, rqout->rq->rqauth, 16); in replyh()
1497 if (rqout->rq->origusername && (attr = radmsg_gettype(msg, RAD_Attr_User_Name))) { in replyh()
1498 if (!resizeattr(attr, strlen(rqout->rq->origusername))) { in replyh()
1502 memcpy(attr->v, rqout->rq->origusername, strlen(rqout->rq->origusername)); in replyh()
1515 radmsg_free(rqout->rq->msg); in replyh()
1516 rqout->rq->msg = msg; in replyh()
1517 sendreply(newrqref(rqout->rq)); in replyh()
1518 freerqoutdata(rqout); in replyh()
1519 pthread_mutex_unlock(rqout->lock); in replyh()
1524 pthread_mutex_unlock(rqout->lock); in replyh()
1555 struct rqout *rqout = NULL; in clientwr() local
1664 rqout = server->requests + i; in clientwr()
1665 if (rqout->rq) { in clientwr()
1666 pthread_mutex_lock(rqout->lock); in clientwr()
1667 if (rqout->rq) in clientwr()
1669 pthread_mutex_unlock(rqout->lock); in clientwr()
1678 if (rqout->tries > 0) in clientwr()
1679 rqout->tries--; in clientwr()
1680 } else if (now.tv_sec < rqout->expiry.tv_sec) { in clientwr()
1681 if (!timeout.tv_sec || rqout->expiry.tv_sec < timeout.tv_sec) in clientwr()
1682 timeout.tv_sec = rqout->expiry.tv_sec; in clientwr()
1683 pthread_mutex_unlock(rqout->lock); in clientwr()
1687 … if (rqout->tries > 0 && now.tv_sec - server->lastrcv.tv_sec > conf->retryinterval && !do_resend) in clientwr()
1689 if (rqout->tries == (*rqout->rq->buf == RAD_Status_Server ? 1 : conf->retrycount + 1)) { in clientwr()
1691 replylog(rqout->rq->msg, server, rqout->rq); in clientwr()
1693 if (*rqout->rq->buf == RAD_Status_Server) { in clientwr()
1699 … if (conf->statusserver == RSP_STATSRV_AUTO && *rqout->rq->buf == RAD_Status_Server) { in clientwr()
1710 freerqoutdata(rqout); in clientwr()
1711 pthread_mutex_unlock(rqout->lock); in clientwr()
1715 rqout->expiry.tv_sec = now.tv_sec + conf->retryinterval; in clientwr()
1716 if (!timeout.tv_sec || rqout->expiry.tv_sec < timeout.tv_sec) in clientwr()
1717 timeout.tv_sec = rqout->expiry.tv_sec; in clientwr()
1718 rqout->tries++; in clientwr()
1719 if (!conf->pdef->clientradput(server, rqout->rq->buf)) { in clientwr()
1724 pthread_mutex_unlock(rqout->lock); in clientwr()