From: Nick Porter Date: Thu, 2 Feb 2023 10:06:35 +0000 (+0000) Subject: Instantiate and free slab with thread X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=065fa85a589ddf4b8d47e90504d6a9b71ce5c05a;p=thirdparty%2Ffreeradius-server.git Instantiate and free slab with thread --- diff --git a/src/modules/rlm_rest/rlm_rest.c b/src/modules/rlm_rest/rlm_rest.c index 8086ad1d167..90bd1313889 100644 --- a/src/modules/rlm_rest/rlm_rest.c +++ b/src/modules/rlm_rest/rlm_rest.c @@ -1167,6 +1167,12 @@ static int mod_thread_instantiate(module_thread_inst_ctx_t const *mctx) 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"); + return -1; + } + mhandle = fr_curl_io_init(t, mctx->el, inst->multiplex); if (!mhandle) return -1; @@ -1189,6 +1195,7 @@ static int mod_thread_detach(module_thread_inst_ctx_t const *mctx) talloc_free(t->mhandle); /* Ensure this is shutdown before the pool */ fr_pool_free(t->pool); + talloc_free(t->slab); return 0; } @@ -1230,6 +1237,9 @@ static int instantiate(module_inst_ctx_t const *mctx) return -1; } + inst->conn_config.reuse.num_children = 1; + inst->conn_config.reuse.child_pool_size = sizeof(rlm_rest_curl_context_t); + return 0; }