* @param ctx rlm_ldap instance.
* @return A new connection handle or NULL on error.
*/
-void *rlm_ldap_conn_create(void *ctx)
+void *mod_conn_create(void *ctx)
{
ldap_rcode_t status;
* @param connection to destroy.
* @return always indicates success.
*/
-int rlm_ldap_conn_delete(UNUSED void *ctx, void *connection)
+int mod_conn_delete(UNUSED void *ctx, void *connection)
{
ldap_handle_t *conn = connection;
/*
* ldap.c - Callbacks for the connection pool API.
*/
-void *rlm_ldap_conn_create(void *ctx);
+void *mod_conn_create(void *ctx);
-int rlm_ldap_conn_delete(UNUSED void *ctx, void *connection);
+int mod_conn_delete(UNUSED void *ctx, void *connection);
ldap_handle_t *rlm_ldap_get_socket(const ldap_instance_t *inst, REQUEST *request);
/*
* Initialize the socket pool.
*/
- inst->pool = fr_connection_pool_init(inst->cs, inst, rlm_ldap_conn_create, NULL, rlm_ldap_conn_delete, NULL);
+ inst->pool = fr_connection_pool_init(inst->cs, inst, mod_conn_create, NULL, mod_conn_delete, NULL);
if (!inst->pool) {
return -1;
}
{ NULL, -1, 0, NULL, NULL} /* end the list */
};
-static int conn_delete(UNUSED void *ctx, void *conn)
+static int mod_conn_delete(UNUSED void *ctx, void *conn)
{
REDISSOCK *dissocket = conn;
return 1;
}
-static void *conn_create(void *ctx)
+static void *mod_conn_create(void *ctx)
{
REDIS_INST *inst = ctx;
REDISSOCK *dissocket = NULL;
xlat_register(inst->xlat_name, redis_xlat, NULL, inst); /* FIXME! */
- inst->pool = fr_connection_pool_init(conf, inst, conn_create, NULL, conn_delete, NULL);
+ inst->pool = fr_connection_pool_init(conf, inst, mod_conn_create, NULL, mod_conn_delete, NULL);
if (!inst->pool) {
return -1;
}
*
* Creates an instances of rlm_rest_handle_t, and rlm_rest_curl_context_t
* which hold the context data required for generating requests and parsing
- * responses. Calling rest_socket_delete will free this memory.
+ * responses. Calling mod_conn_delete will free this memory.
*
* If instance->connect_uri is not NULL libcurl will attempt to open a
* TCP socket to the server specified in the URI. This is done so that when the
* socket is first used, there will already be a cached TCP connection to the
* REST server associated with the curl handle.
*
- * @see rest_socket_delete
+ * @see mod_conn_delete
* @see fr_connection_pool_init
* @see fr_connection_create_t
* @see connection.c
* @return connection handle or NULL if the connection failed or couldn't
* be initialised.
*/
-void *rest_socket_create(void *instance)
+void *mod_conn_create(void *instance)
{
rlm_rest_t *inst = instance;
* @returns FALSE if the last socket is dead, or if the socket state couldn't be
* determined, else TRUE.
*/
-int rest_socket_alive(void *instance, void *handle)
+int mod_conn_alive(void *instance, void *handle)
{
rlm_rest_t *inst = instance;
rlm_rest_handle_t *randle = handle;
* @param[in] handle rlm_rest_handle_t to close and free.
* @return returns TRUE.
*/
-int rest_socket_delete(UNUSED void *instance, void *handle)
+int mod_conn_delete(UNUSED void *instance, void *handle)
{
rlm_rest_handle_t *randle = handle;
CURL *candle = randle->handle;
void rest_cleanup(void);
-void *rest_socket_create(void *instance);
+void *mod_conn_create(void *instance);
-int rest_socket_alive(void *instance, void *handle);
+int mod_conn_alive(void *instance, void *handle);
-int rest_socket_delete(void *instance, void *handle);
+int mod_conn_delete(void *instance, void *handle);
/*
* Request processing API
return -1;
}
- inst->conn_pool = fr_connection_pool_init(conf, inst, rest_socket_create, rest_socket_alive, rest_socket_delete, NULL);
+ inst->conn_pool = fr_connection_pool_init(conf, inst, mod_conn_create, mod_conn_alive, mod_conn_delete, NULL);
if (!inst->conn_pool) {
return -1;
}
};
-static void *conn_create(void *ctx)
+static void *mod_conn_create(void *ctx)
{
int fd;
struct sockaddr_un sa;
return fdp;
}
-static int conn_delete(UNUSED void *ctx, void *connection)
+static int mod_conn_delete(UNUSED void *ctx, void *connection)
{
int *fdp = connection;
/*
* Initialize the socket pool.
*/
- inst->pool = fr_connection_pool_init(conf, inst, conn_create, NULL, conn_delete, NULL);
+ inst->pool = fr_connection_pool_init(conf, inst, mod_conn_create, NULL, mod_conn_delete, NULL);
if (!inst->pool) {
return -1;
}
return 0;
}
-static void *sql_conn_create(void *ctx)
+static void *mod_conn_create(void *ctx)
{
int rcode;
rlm_sql_t *inst = ctx;
/*
* @todo Calls to this should eventually go away.
*/
-static int sql_conn_delete(UNUSED void *ctx, void *conn)
+static int mod_conn_delete(UNUSED void *ctx, void *conn)
{
return talloc_free(conn);
}
int sql_socket_pool_init(rlm_sql_t * inst)
{
inst->pool = fr_connection_pool_init(inst->cs, inst,
- sql_conn_create, NULL, sql_conn_delete,
+ mod_conn_create, NULL, mod_conn_delete,
NULL);
if (!inst->pool) return -1;
* fr_connection_pool_init, and called when a new connection is required by the
* connection pool API.
*
- * @see rest_socket_delete
+ * @see mod_conn_delete
* @see fr_connection_pool_init
* @see fr_connection_create_t
* @see connection.c