From: Nick Porter Date: Thu, 2 Feb 2023 10:17:29 +0000 (+0000) Subject: Remove pool from rlm_rest X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8890d097393319bff976dfb7deb3ea8a2bee6733;p=thirdparty%2Ffreeradius-server.git Remove pool from rlm_rest --- diff --git a/src/modules/rlm_rest/rest.h b/src/modules/rlm_rest/rest.h index 774661bd629..901e2d9bba7 100644 --- a/src/modules/rlm_rest/rest.h +++ b/src/modules/rlm_rest/rest.h @@ -28,7 +28,6 @@ RCSIDH(rest_h, "$Id$") #include #include #include -#include #include /* @@ -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. diff --git a/src/modules/rlm_rest/rlm_rest.c b/src/modules/rlm_rest/rlm_rest.c index 12a8582e249..5e34e4cdaea 100644 --- a/src/modules/rlm_rest/rlm_rest.c +++ b/src/modules/rlm_rest/rlm_rest.c @@ -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;