From: Alan T. DeKok Date: Fri, 21 Sep 2018 17:21:50 +0000 (-0400) Subject: Revert "move "free clients" to mod_close(), instead of mod_detach()" X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=410becd712bdc5e4a028c04ca1398d86e4dfcaa2;p=thirdparty%2Ffreeradius-server.git Revert "move "free clients" to mod_close(), instead of mod_detach()" 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() --- diff --git a/src/lib/io/master.c b/src/lib/io/master.c index 65037569921..94452955623 100644 --- a/src/lib/io/master.c +++ b/src/lib/io/master.c @@ -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,