add modules.sql.fail trigger. Fixes #1923
authorAlan T. DeKok <aland@freeradius.org>
Fri, 24 Feb 2017 16:51:40 +0000 (11:51 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 24 Feb 2017 16:51:40 +0000 (11:51 -0500)
The connection pool knows when connections are opened / closed.
It doesn't know as much when a connection fails

src/modules/rlm_sql/rlm_sql.c

index 6050246..3a032d3 100644 (file)
@@ -947,6 +947,8 @@ static void *mod_conn_create(TALLOC_CTX *ctx, void *instance)
        rcode = (inst->module->sql_socket_init)(handle, inst->config);
        if (rcode != 0) {
        fail:
+               exec_trigger(NULL, inst->cs, "modules.sql.fail", true);
+
                /*
                 *      Destroy any half opened connections.
                 */