]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Remove SQL pool connection function
authorNick Porter <nick@portercomputing.co.uk>
Tue, 26 Nov 2024 17:27:56 +0000 (17:27 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 27 Nov 2024 08:05:02 +0000 (08:05 +0000)
src/modules/rlm_sql/rlm_sql.h
src/modules/rlm_sql/sql.c

index 7faba841f9362ef017501234917b2035d98190a0..089c2a9b1de919c1a1b17c32867f818b48c8e3fb 100644 (file)
@@ -255,7 +255,6 @@ struct sql_inst {
        module_instance_t const *mi;                    //!< Module instance data for thread lookups.
 };
 
-void           *sql_mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout);
 unlang_action_t        sql_get_map_list(request_t *request, fr_sql_map_ctx_t *map_ctx, trunk_t *trunk);
 void           rlm_sql_query_log(rlm_sql_t const *inst, char const *filename, char const *query) CC_HINT(nonnull);
 unlang_action_t rlm_sql_select_query(rlm_rcode_t *p_result, UNUSED int *priority, request_t *request, void *uctx);
index 370d7840158507f8f2062d303681c64be06f7c37..6e5d5d3a0fb4079b454f7c4447a79773def7125c 100644 (file)
@@ -62,56 +62,6 @@ fr_table_num_sorted_t const sql_rcode_table[] = {
 };
 size_t sql_rcode_table_len = NUM_ELEMENTS(sql_rcode_table);
 
-void *sql_mod_conn_create(TALLOC_CTX *ctx, void *instance, fr_time_delta_t timeout)
-{
-       int rcode;
-       rlm_sql_t *inst = talloc_get_type_abort(instance, rlm_sql_t);
-       rlm_sql_handle_t *handle;
-
-       /*
-        *      Connections cannot be alloced from the inst or
-        *      pool contexts due to threading issues.
-        */
-       handle = talloc_zero(ctx, rlm_sql_handle_t);
-       if (!handle) return NULL;
-
-       handle->log_ctx = talloc_pool(handle, 2048);
-       if (!handle->log_ctx) {
-               talloc_free(handle);
-               return NULL;
-       }
-
-       /*
-        *      Handle requires a pointer to the SQL inst so the
-        *      destructor has access to the module configuration.
-        */
-       handle->inst = inst;
-
-       rcode = (inst->driver->sql_socket_init)(handle, &inst->config, timeout);
-       if (rcode != 0) {
-       fail:
-               /*
-                *      Destroy any half opened connections.
-                */
-               talloc_free(handle);
-               return NULL;
-       }
-
-       if (inst->config.connect_query) {
-               fr_sql_query_t  *query_ctx;
-               rlm_rcode_t     p_result;
-               MEM(query_ctx = fr_sql_query_alloc(ctx, inst, NULL, handle, NULL, inst->config.connect_query, SQL_QUERY_OTHER));
-               inst->query(&p_result, NULL, NULL, query_ctx);
-               if (query_ctx->rcode != RLM_SQL_OK) {
-                       talloc_free(query_ctx);
-                       goto fail;
-               }
-               talloc_free(query_ctx);
-       }
-
-       return handle;
-}
-
 #if 0
 /*************************************************************************
  *