]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Revert "move "free clients" to mod_close(), instead of mod_detach()"
authorAlan T. DeKok <aland@freeradius.org>
Fri, 21 Sep 2018 17:21:50 +0000 (13:21 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 21 Sep 2018 17:21:50 +0000 (13:21 -0400)
This reverts commit a505ccc195fc49847166ad2bf3839e099282944b.

we don't yet have thread-specific data structures for sockets.
so the "alive_clients" are still in the app_io_instance, not the
thread_instance.  Once we have thread data, the alive_clients
can move there, and then be free'd on mod_close()

src/lib/io/master.c

index 650375699211dc531e98a9b3e360938c1cc1d899..94452955623e7f46d0422ea41c4f425cd7757047 100644 (file)
@@ -2297,7 +2297,6 @@ static int mod_close(fr_listen_t *li)
        fr_io_instance_t *inst;
        fr_io_connection_t *connection;
        fr_listen_t *child;
-       fr_io_client_t *client;
 
        get_inst(li->app_io_instance, &inst, &connection, &child);
 
@@ -2323,6 +2322,23 @@ static int mod_close(fr_listen_t *li)
                talloc_free(connection->dl_inst);
        }
 
+       return 0;
+}
+
+
+static int mod_detach(void *instance)
+{
+       fr_io_instance_t *inst;
+       fr_io_connection_t *connection;
+       fr_listen_t *child;
+       int rcode;
+       fr_io_client_t *client;
+
+       get_inst(instance, &inst, &connection, &child);
+
+       rcode = inst->app_io->detach(child->app_io_instance);
+       if (rcode < 0) return rcode;
+
        /*
         *      Each client is it's own talloc context, so we have to
         *      clean them up individually.
@@ -2660,6 +2676,7 @@ fr_app_io_t fr_master_app_io = {
        .magic                  = RLM_MODULE_INIT,
        .name                   = "radius_master_io",
 
+       .detach                 = mod_detach,
        .bootstrap              = mod_bootstrap,
        .instantiate            = mod_instantiate,