/** Free an rlm_radius_link_t
*
- * Unlink it from the running list, and remove it from the
- * transport.
*/
static int mod_link_free(rlm_radius_link_t *link)
{
- fr_dlist_remove(&link->t->running, link);
-
/*
* Free the child's request io context. That will call
* the IO submodules destructor, which will remove it
}
if (inst->io->request_inst_type) talloc_set_name_const(link->request_io_ctx, inst->io->request_inst_type);
- link->t = t;
link->request = request;
-
link->rcode = RLM_MODULE_FAIL;
/*
*/
radius_fixups(inst, request);
- fr_dlist_insert_tail(&t->running, link);
talloc_set_destructor(link, mod_link_free);
/*
t->inst = instance;
t->el = el;
- fr_dlist_init(&t->running, rlm_radius_link_t, entry);
-
/*
* Allocate thread-specific data. The connections should
* live here.
return -1;
}
- /*
- * The scheduler MUST be destroyed before this modules
- * thread memory is freed. That ordering ensures that
- * all of the requests for a worker thread are forcibly
- * marked DONE, and (in an ideal world) resumed / cleaned
- * up before this memory is freed.
- */
- if (fr_dlist_head(&t->running) != NULL) {
- ERROR("Module still has running requests!");
- return -1;
- }
-
return 0;
}
rlm_radius_t const *inst; //!< Instance of the module.
fr_event_list_t *el; //!< This thread's event list.
- fr_dlist_head_t running; //!< running requests
-
void *thread_io_ctx; //!< thread context for the IO submodule
} rlm_radius_thread_t;
*/
struct rlm_radius_link_t {
REQUEST *request; //!< the request we are for, so we can find it from the link
- rlm_radius_thread_t *t; //!< thread context for rlm_radius
- fr_dlist_t entry; //!< linked list of active requests for rlm_radius
fr_time_t time_sent; //!< when we sent the packet
fr_time_t time_recv; //!< when we received the reply