Use consistent names for the connection functions
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 15 Apr 2013 17:13:29 +0000 (13:13 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 15 Apr 2013 17:13:29 +0000 (13:13 -0400)
src/modules/rlm_ldap/ldap.c
src/modules/rlm_ldap/ldap.h
src/modules/rlm_ldap/rlm_ldap.c
src/modules/rlm_redis/rlm_redis.c
src/modules/rlm_rest/rest.c
src/modules/rlm_rest/rest.h
src/modules/rlm_rest/rlm_rest.c
src/modules/rlm_smsotp/rlm_smsotp.c
src/modules/rlm_sql/sql.c
src/modules/rlm_yubikey/validate.c

index a1bfec3..c51c82f 100644 (file)
@@ -1012,7 +1012,7 @@ static int rlm_ldap_rebind(LDAP *handle, LDAP_CONST char *url, UNUSED ber_tag_t
  * @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;
        
@@ -1182,7 +1182,7 @@ void *rlm_ldap_conn_create(void *ctx)
  * @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;
 
index 8b75537..d07d4f5 100644 (file)
@@ -290,9 +290,9 @@ void rlm_ldap_check_reply(const ldap_instance_t *inst, REQUEST *request);
 /*
  *     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);
 
index 4be364b..6385468 100644 (file)
@@ -598,7 +598,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
        /*
         *      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;
        }
index cd83cf8..1a4eadb 100644 (file)
@@ -42,7 +42,7 @@ static const CONF_PARSER module_config[] = {
        { 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;
 
@@ -57,7 +57,7 @@ static int conn_delete(UNUSED void *ctx, void *conn)
        return 1;
 }
 
-static void *conn_create(void *ctx)
+static void *mod_conn_create(void *ctx)
 {
        REDIS_INST *inst = ctx;
        REDISSOCK *dissocket = NULL;
@@ -287,7 +287,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
 
        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;
        }
index 755234b..e52c095 100644 (file)
@@ -255,14 +255,14 @@ void rest_cleanup(void)
  *
  * 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
@@ -271,7 +271,7 @@ void rest_cleanup(void)
  * @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;
 
@@ -367,7 +367,7 @@ void *rest_socket_create(void *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;
@@ -399,7 +399,7 @@ int rest_socket_alive(void *instance, void *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;
index 35ac641..401e942 100644 (file)
@@ -229,11 +229,11 @@ int rest_init(rlm_rest_t *instance);
 
 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
index 7aba6b7..79dfd04 100644 (file)
@@ -255,7 +255,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
                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;
        }
index f8ef4b3..72e08f1 100644 (file)
@@ -48,7 +48,7 @@ static const CONF_PARSER module_config[] = {
 };
 
 
-static void *conn_create(void *ctx)
+static void *mod_conn_create(void *ctx)
 {
        int fd;
        struct sockaddr_un sa;
@@ -78,7 +78,7 @@ static void *conn_create(void *ctx)
        return fdp;
 }
 
-static int conn_delete(UNUSED void *ctx, void *connection)
+static int mod_conn_delete(UNUSED void *ctx, void *connection)
 {
        int *fdp = connection;
 
@@ -181,7 +181,7 @@ static int mod_instantiate(CONF_SECTION *conf, void *instance)
        /*
         *      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;
        }
index a9b111e..328d6ea 100644 (file)
@@ -51,7 +51,7 @@ static int sql_conn_destructor(void *conn)
        return 0;
 }
 
-static void *sql_conn_create(void *ctx)
+static void *mod_conn_create(void *ctx)
 {
        int rcode;
        rlm_sql_t *inst = ctx;
@@ -92,7 +92,7 @@ static void *sql_conn_create(void *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);
 }
@@ -107,7 +107,7 @@ static int sql_conn_delete(UNUSED void *ctx, void *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;
 
index 31cf2bd..00b28d4 100644 (file)
@@ -18,7 +18,7 @@
  * 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