]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
we shouldn't track which requests are using this module
authorAlan T. DeKok <aland@freeradius.org>
Fri, 2 Nov 2018 15:24:13 +0000 (11:24 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 2 Nov 2018 15:27:52 +0000 (11:27 -0400)
the unlang interpreter does that.  The rest of the code should
guarantee that all requests are stopped / freed before a module
is detached.

src/modules/rlm_radius/rlm_radius.c
src/modules/rlm_radius/rlm_radius.h

index 3d2d13c4924a41564470f4cfbd668615915dbb7d..ceddbfde5c61242ae7475223c7d71c1b43ffb619 100644 (file)
@@ -381,13 +381,9 @@ static int status_check_update_parse(TALLOC_CTX *ctx, void *out, UNUSED void *pa
 
 /** 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
@@ -545,9 +541,7 @@ static rlm_rcode_t CC_HINT(nonnull) mod_process(void *instance, void *thread, RE
        }
        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;
 
        /*
@@ -557,7 +551,6 @@ static rlm_rcode_t CC_HINT(nonnull) mod_process(void *instance, void *thread, RE
         */
        radius_fixups(inst, request);
 
-       fr_dlist_insert_tail(&t->running, link);
        talloc_set_destructor(link, mod_link_free);
 
        /*
@@ -812,8 +805,6 @@ static int mod_thread_instantiate(UNUSED CONF_SECTION const *cs, void *instance,
        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.
@@ -852,18 +843,6 @@ static int mod_thread_detach(fr_event_list_t *el, void *thread)
                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;
 }
 
index 1bae7b50c621cf80d6f8bfd72c2e193e749682a5..a5c37af0ba926f218ae247689df2af11ba0b5160 100644 (file)
@@ -112,8 +112,6 @@ typedef struct rlm_radius_thread_t {
        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;
 
@@ -122,8 +120,6 @@ typedef struct 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