int code; //!< Packet code.
rlm_radius_udp_connection_t *c; //!< The connection state machine.
+ rlm_radius_udp_thread_t *thread; //!< the thread data for this request
rlm_radius_link_t *link; //!< More link stuff.
rlm_radius_request_t *rr; //!< ID tracking, resend count, etc.
/** Deal with per-request timeouts for transmissions, etc.
*
*/
-static void response_timeout(UNUSED fr_event_list_t *el, struct timeval *now, void *uctx)
+static void response_timeout(fr_event_list_t *el, struct timeval *now, void *uctx)
{
int rcode;
rlm_radius_udp_request_t *u = uctx;
REQUEST *request;
rad_assert(u->timer.retry == &c->inst->parent->retry[u->code]);
- rcode = rr_track_retry(c->id, u->rr, c->thread->el, response_timeout, u, now);
+ rcode = rr_track_retry(c->id, u->rr, el, response_timeout, u, now);
if (rcode < 0) {
/*
* Failed inserting event... the request is done.
*
* For now, there's only one connection.
*/
-static rlm_radius_udp_connection_t *connection_get(rlm_radius_udp_thread_t *t, rlm_radius_udp_request_t *u)
+static rlm_radius_udp_connection_t *connection_get(rlm_radius_udp_request_t *u)
{
rlm_radius_udp_connection_t *c;
+ rlm_radius_udp_thread_t *t = u->thread;
c = fr_heap_peek(t->active);
if (!c) return NULL;
if (!c) return;
while ((u = fr_heap_pop(t->queued)) != NULL) {
- c = connection_get(t, u);
+ rad_assert(u->thread == t);
+ c = connection_get(u);
if (!c) break;
/*
u->link = link;
u->code = request->packet->code;
+ u->thread = t;
FR_DLIST_INIT(u->entry);
talloc_set_destructor(u, udp_request_free);
* Get a connection. If they're all full, try to open a
* new one.
*/
- c = connection_get(t, u);
+ c = connection_get(u);
if (!c) {
fr_dlist_t *entry;