]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove pool from rlm_rest
authorNick Porter <nick@portercomputing.co.uk>
Thu, 2 Feb 2023 10:17:29 +0000 (10:17 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 15 Feb 2023 16:11:34 +0000 (16:11 +0000)
src/modules/rlm_rest/rest.h
src/modules/rlm_rest/rlm_rest.c

index 774661bd629342bf82eaa84dc429c0bf55e73703..901e2d9bba79ee0858133888c3cdb61c04d7548c 100644 (file)
@@ -28,7 +28,6 @@ RCSIDH(rest_h, "$Id$")
 #include <freeradius-devel/curl/base.h>
 #include <freeradius-devel/curl/config.h>
 #include <freeradius-devel/server/pairmove.h>
-#include <freeradius-devel/server/pool.h>
 #include <freeradius-devel/util/slab.h>
 
 /*
@@ -156,8 +155,6 @@ typedef struct {
        bool                    multiplex;      //!< Whether to perform multiple requests using a single
                                                ///< connection.
 
-       fr_pool_t               *pool;          //!< Pointer to the connection pool.
-
        fr_curl_conn_config_t   conn_config;    //!< Configuration of slab allocated connection handles.
 
        rlm_rest_section_t      xlat;           //!< Configuration specific to xlat.
@@ -180,7 +177,6 @@ FR_SLAB_FUNCS(rest, fr_curl_io_request_t)
  */
 typedef struct {
        rlm_rest_t const        *inst;          //!< Instance of rlm_rest.
-       fr_pool_t               *pool;          //!< Thread specific connection pool.
        fr_rest_slab_list_t     *slab;          //!< Slab list for connection handles.
        fr_curl_handle_t        *mhandle;       //!< Thread specific multi handle.  Serves as the dispatch
                                                //!< and coralling structure for REST requests.
index 12a8582e2491ae11537edcae132599e7582ff6d5..5e34e4cdaeaf183bbb2a4a851fae4d14860e171a 100644 (file)
@@ -1134,34 +1134,10 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx)
 {
        rlm_rest_t              *inst = talloc_get_type_abort(mctx->inst->data, rlm_rest_t);
        rlm_rest_thread_t       *t = talloc_get_type_abort(mctx->thread, rlm_rest_thread_t);
-       CONF_SECTION            *conf = mctx->inst->conf;
        fr_curl_handle_t        *mhandle;
-       CONF_SECTION            *my_conf = NULL, *pool;
 
        t->inst = inst;
 
-       /*
-        *      Temporary hack to make config parsing
-        *      thread safe.
-        */
-       if ((pool = cf_section_find(conf, "pool", NULL))) {
-               my_conf = cf_section_dup(NULL, NULL, pool, cf_section_name1(pool), cf_section_name2(pool), true);
-       } else {
-               my_conf = cf_section_alloc(NULL, NULL, "pool", NULL);
-       }
-       t->pool = fr_pool_init(NULL, my_conf, inst, rest_mod_conn_create, NULL, mctx->inst->name);
-       talloc_free(my_conf);
-
-       if (!t->pool) {
-               ERROR("Pool instantiation failed");
-               return -1;
-       }
-
-       if (fr_pool_start(t->pool) < 0) {
-               ERROR("Starting initial connections failed");
-               return -1;
-       }
-
        if (fr_rest_slab_list_alloc(t, &t->slab, mctx->el, &inst->conn_config.reuse,
                                    rest_conn_alloc, NULL, inst, false) < 0) {
                ERROR("Connection handle pool instantiation failed");
@@ -1189,7 +1165,6 @@ static int mod_thread_detach(module_thread_inst_ctx_t const *mctx)
        rlm_rest_thread_t *t = talloc_get_type_abort(mctx->thread, rlm_rest_thread_t);
 
        talloc_free(t->mhandle);        /* Ensure this is shutdown before the pool */
-       fr_pool_free(t->pool);
        talloc_free(t->slab);
 
        return 0;