]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Correct enum case
authorNick Porter <nick@portercomputing.co.uk>
Wed, 26 Jun 2024 12:12:47 +0000 (13:12 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 26 Jun 2024 12:12:47 +0000 (13:12 +0100)
src/lib/ldap/connection.c
src/lib/ldap/state.c
src/lib/redis/io.c
src/lib/server/connection.c
src/lib/server/connection.h
src/lib/server/trunk_tests.c
src/listen/ldap_sync/proto_ldap_sync_ldap.c
src/modules/rlm_logtee/rlm_logtee.c
src/modules/rlm_radius/rlm_radius_udp.c
src/modules/rlm_sql/drivers/rlm_sql_mysql/rlm_sql_mysql.c
src/modules/rlm_tacacs/rlm_tacacs_tcp.c

index 9b08931431ec23d3d39b5d82d93f91a091a6c6ad..4000c1dfda2c20f198eddeacafedde5f93a5f0da 100644 (file)
@@ -572,7 +572,7 @@ static void ldap_conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED in
 
        ERROR("%s - Connection failed: %s", tconn->conn->name, fr_syserror(fd_errno));
 
-       connection_signal_reconnect(tconn->conn, connection_FAILED);
+       connection_signal_reconnect(tconn->conn, CONNECTION_FAILED);
 }
 
 /** Setup callbacks requested by LDAP trunk connections
@@ -616,7 +616,7 @@ static void ldap_trunk_connection_notify(trunk_connection_t *tconn, connection_t
                               ldap_conn_error,
                               tconn) < 0) {
                PERROR("Failed inserting FD event");
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -719,8 +719,7 @@ static void ldap_trunk_request_mux(UNUSED fr_event_list_t *el, trunk_connection_
                        ERROR("Invalid LDAP query for trunk connection");
                error:
                        trunk_request_signal_fail(query->treq);
-                       if (status == LDAP_PROC_BAD_CONN) trunk_connection_signal_reconnect(tconn,
-                                                                                              connection_FAILED);
+                       if (status == LDAP_PROC_BAD_CONN) trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        continue;
 
                }
@@ -804,7 +803,7 @@ static void ldap_trunk_request_demux(fr_event_list_t *el, trunk_connection_t *tc
                        rcode = fr_ldap_error_check(NULL, ldap_conn, NULL, NULL);
                        if (rcode == LDAP_PROC_BAD_CONN) {
                                ERROR("Bad LDAP connection");
-                               connection_signal_reconnect(tconn->conn, connection_FAILED);
+                               connection_signal_reconnect(tconn->conn, CONNECTION_FAILED);
                        }
                        return;
 
@@ -1322,7 +1321,7 @@ static void ldap_bind_auth_cancel_mux(UNUSED fr_event_list_t *el, trunk_connecti
                         *      seems to leave the connection in an unpredictable state
                         *      so safer to restart.
                         */
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                } else {
 #endif
                        ldap_abandon_ext(ldap_conn->handle, bind->msgid, NULL, NULL);
index c70957d61b8f1f5aaf569167edd18d12e85ca5ab..fb069a7ef58500950114cb0d5b9b1ad1f912533b 100644 (file)
@@ -118,7 +118,7 @@ again:
        case FR_LDAP_STATE_RUN:         /* There's no next state for run, so this an error */
        case FR_LDAP_STATE_ERROR:
                STATE_TRANSITION(FR_LDAP_STATE_INIT);
-               connection_signal_reconnect(c->conn, connection_FAILED);
+               connection_signal_reconnect(c->conn, CONNECTION_FAILED);
                /*
                 *      The old connection has been freed, so specifically return the INIT state
                 */
index 83951b1223f241949e5a1cdfda981f1097455657..9e873dabd9cdd6938f3ad99f84ffeaa65e6c09ad 100644 (file)
@@ -51,7 +51,7 @@ static void _redis_disconnected(redisAsyncContext const *ac, UNUSED int status)
 
        DEBUG4("Signalled by hiredis, connection disconnected");
 
-       connection_signal_reconnect(conn, connection_FAILED);
+       connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
 /** Called by hiredis to indicate the connection is live
@@ -106,7 +106,7 @@ static void _redis_io_service_errored(UNUSED fr_event_list_t *el, int fd, UNUSED
        /*
         *      Connection state machine will handle reconnecting
         */
-       connection_signal_reconnect(conn, connection_FAILED);
+       connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
 /** Deal with the method hiredis uses to register/unregister interest in a file descriptor
index fb4b174bd6a563b4339566bd95a8256b9bd70fa4..2b9c5e8c35c7c3739e6a321ebbe065c062841fe5 100644 (file)
@@ -271,11 +271,11 @@ static void connection_deferred_signal_process(connection_t *conn)
                        break;
 
                case CONNECTION_DSIGNAL_RECONNECT_FAILED:               /* Reconnect - Failed */
-                       connection_signal_reconnect(conn, connection_FAILED);
+                       connection_signal_reconnect(conn, CONNECTION_FAILED);
                        break;
 
                case CONNECTION_DSIGNAL_RECONNECT_EXPIRED:              /* Reconnect - Expired */
-                       connection_signal_reconnect(conn, connection_EXPIRED);
+                       connection_signal_reconnect(conn, CONNECTION_EXPIRED);
                        break;
 
                case CONNECTION_DSIGNAL_SHUTDOWN:
@@ -1169,7 +1169,7 @@ void connection_signal_reconnect(connection_t *conn, connection_reason_t reason)
               fr_table_str_by_value(connection_states, conn->pub.state, "<INVALID>"));
 
        if (DEFER_SIGNALS(conn)) {
-               if ((reason == connection_EXPIRED) && conn->shutdown) {
+               if ((reason == CONNECTION_EXPIRED) && conn->shutdown) {
                        connection_deferred_signal_add(conn, CONNECTION_DSIGNAL_RECONNECT_EXPIRED);
                        return;
                }
@@ -1188,12 +1188,12 @@ void connection_signal_reconnect(connection_t *conn, connection_reason_t reason)
                break;
 
        case CONNECTION_STATE_SHUTDOWN:
-               if (reason == connection_EXPIRED) break;        /* Already shutting down */
+               if (reason == CONNECTION_EXPIRED) break;        /* Already shutting down */
                connection_state_enter_failed(conn);
                break;
 
        case CONNECTION_STATE_CONNECTED:
-               if (reason == connection_EXPIRED) {
+               if (reason == CONNECTION_EXPIRED) {
                        if (conn->shutdown) {
                                connection_state_enter_shutdown(conn);
                                break;
index cfbcaf8970fb0903972e825a7153d9be7455ce63..3b034a0e075b1b7419b2a5b35536044fd0e106d2 100644 (file)
@@ -81,8 +81,8 @@ struct connection_pub_s {
 };
 
 typedef enum {
-       connection_FAILED = 0,          //!< Connection is being reconnected because it failed.
-       connection_EXPIRED                      //!< Connection is being reconnected because it's at
+       CONNECTION_FAILED = 0,                  //!< Connection is being reconnected because it failed.
+       CONNECTION_EXPIRED                      //!< Connection is being reconnected because it's at
                                                ///< the end of its life.  In this case we enter the
                                                ///< closing state and try and close the connection
                                                ///< gracefully.
index ee108ff485588e254e43f8555c6cf498b481c27c..2601780fbda19337056e02b3534d7a5e577c7988 100644 (file)
@@ -154,7 +154,7 @@ static void _conn_io_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int
 
        trunk_connection_t      *tconn = talloc_get_type_abort(uctx, trunk_connection_t);
 
-       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
 }
 
 static void _conn_io_read(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int flags, void *uctx)
@@ -453,7 +453,7 @@ static void test_socket_pair_alloc_then_reconnect_then_free(void)
        TEST_CHECK(events == 0);        /* I/O events should have been cleared */
        TEST_MSG("Got %u events", events);
 
-       trunk_reconnect(trunk, TRUNK_CONN_ACTIVE, connection_FAILED);
+       trunk_reconnect(trunk, TRUNK_CONN_ACTIVE, CONNECTION_FAILED);
 
        test_time_base = fr_time_add_time_delta(test_time_base, fr_time_delta_from_sec(2));
        events = fr_event_corral(el, test_time_base, true);
@@ -630,7 +630,7 @@ static void test_socket_pair_alloc_then_reconnect_check_delay(void)
        /*
         *      Trigger reconnection
         */
-       connection_signal_reconnect(tconn->pub.conn, connection_FAILED);
+       connection_signal_reconnect(tconn->pub.conn, CONNECTION_FAILED);
        test_time_base = fr_time_add_time_delta(test_time_base, fr_time_delta_from_nsec(NSEC * 0.5));
 
        events = fr_event_corral(el, test_time_base, false);
@@ -1121,7 +1121,7 @@ static void test_requeue_on_reconnect(void)
        tconn = treq->pub.tconn;        /* Store the conn the request was assigned to */
        TEST_CHECK_LEN(trunk_request_count_by_state(trunk, TRUNK_CONN_ALL, TRUNK_REQUEST_STATE_PENDING), 1);
 
-       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
 
        /*
         *      Should be reassigned to the other connection
@@ -1132,7 +1132,7 @@ static void test_requeue_on_reconnect(void)
        /*
         *      Should be reassigned to the backlog
         */
-       trunk_connection_signal_reconnect(treq->pub.tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(treq->pub.tconn, CONNECTION_FAILED);
        TEST_CHECK_LEN(trunk_request_count_by_state(trunk, TRUNK_CONN_ALL, TRUNK_REQUEST_STATE_BACKLOG), 1);
        TEST_CHECK(!treq->pub.tconn);
 
@@ -1167,7 +1167,7 @@ static void test_requeue_on_reconnect(void)
         *      then be re-assigned.
         */
        tconn = treq->pub.tconn;
-       trunk_connection_signal_reconnect(treq->pub.tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(treq->pub.tconn, CONNECTION_FAILED);
 
        TEST_CHECK(preq->completed == false);
        TEST_CHECK(preq->failed == false);
@@ -1197,7 +1197,7 @@ static void test_requeue_on_reconnect(void)
        TEST_CHECK_LEN(trunk_request_count_by_state(trunk, TRUNK_CONN_ALL, TRUNK_REQUEST_STATE_SENT), 1);
 
        tconn = treq->pub.tconn;
-       trunk_connection_signal_reconnect(treq->pub.tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(treq->pub.tconn, CONNECTION_FAILED);
 
        TEST_CHECK_LEN(trunk_request_count_by_state(trunk, TRUNK_CONN_ALL, TRUNK_REQUEST_STATE_PENDING), 1);
 
@@ -1230,7 +1230,7 @@ static void test_requeue_on_reconnect(void)
         *      freed instead of being moved between
         *      connections.
         */
-       trunk_connection_signal_reconnect(tconn, connection_FAILED);    /* treq->pub.tconn, now invalid due to cancel */
+       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);    /* treq->pub.tconn, now invalid due to cancel */
 
        test_time_base = fr_time_add_time_delta(test_time_base, fr_time_delta_from_sec(1));
        fr_event_corral(el, test_time_base, false);
@@ -1295,7 +1295,7 @@ static void test_requeue_on_reconnect(void)
        /*
         *      Trigger a reconnection
         */
-       trunk_connection_signal_reconnect(treq->pub.tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(treq->pub.tconn, CONNECTION_FAILED);
 
        test_time_base = fr_time_add_time_delta(test_time_base, fr_time_delta_from_sec(1));
        fr_event_corral(el, test_time_base, false);
@@ -1351,7 +1351,7 @@ static void test_requeue_on_reconnect(void)
        /*
         *      Trigger a reconnection
         */
-       trunk_connection_signal_reconnect(treq->pub.tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(treq->pub.tconn, CONNECTION_FAILED);
 
        test_time_base = fr_time_add_time_delta(test_time_base, fr_time_delta_from_sec(1));
        fr_event_corral(el, test_time_base, false);
index 1317772c2873200761d399e43609925a4580e377..8c0d0e0866b5c80b14aabab813f319048c0e8ea7 100644 (file)
@@ -1078,7 +1078,7 @@ static void _proto_ldap_socket_open_read(fr_event_list_t *el, int fd, UNUSED int
        error:
                talloc_free(dir_ctx);
                if (local) talloc_free(local);
-               connection_signal_reconnect(ldap_conn->conn, connection_FAILED);
+               connection_signal_reconnect(ldap_conn->conn, CONNECTION_FAILED);
                return;
        }
 
index aec818b235d3370dca58f4a520869ed077c9e7f7..b32db1099cf078fbcac0aa18b3e7cf0e04c7a4e9 100644 (file)
@@ -219,7 +219,7 @@ static void _logtee_conn_error(UNUSED fr_event_list_t *el, int sock, UNUSED int
        /*
         *      Something bad happened... Fix it...
         */
-       connection_signal_reconnect(t->conn, connection_FAILED);
+       connection_signal_reconnect(t->conn, CONNECTION_FAILED);
 }
 
 /** Drain any data we received
@@ -244,7 +244,7 @@ static void _logtee_conn_read(UNUSED fr_event_list_t *el, int sock, UNUSED int f
                case ETIMEDOUT:
                case EIO:
                case ENXIO:
-                       connection_signal_reconnect(t->conn, connection_FAILED);
+                       connection_signal_reconnect(t->conn, CONNECTION_FAILED);
                        return;
 
                /*
@@ -289,7 +289,7 @@ static void _logtee_conn_writable(UNUSED fr_event_list_t *el, int sock, UNUSED i
                        case ENXIO:
                        case EPIPE:
                        case ENETDOWN:
-                               connection_signal_reconnect(t->conn, connection_FAILED);
+                               connection_signal_reconnect(t->conn, CONNECTION_FAILED);
                                return;
 
                        /*
index 9cf930bc55e4cdee0a1911076e0eef5edd42b914..089ef1bf8cbe83b9f430d75813f354f0aec51174 100644 (file)
@@ -443,7 +443,7 @@ static void conn_error_status_check(UNUSED fr_event_list_t *el, UNUSED int fd, U
 
        ERROR("%s - Connection %s failed: %s", h->module_name, h->name, fr_syserror(fd_errno));
 
-       connection_signal_reconnect(conn, connection_FAILED);
+       connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
 /** Status check timer when opening the connection for the first time.
@@ -480,14 +480,14 @@ static void conn_status_check_timeout(fr_event_list_t *el, fr_time_t now, void *
                DEBUG("%s - Reached maximum_retransmit_count (%u > %u), failing status checks",
                      h->module_name, u->retry.count, u->retry.config->mrc);
        fail:
-               connection_signal_reconnect(conn, connection_FAILED);
+               connection_signal_reconnect(conn, CONNECTION_FAILED);
                return;
 
        case FR_RETRY_CONTINUE:
                if (fr_event_fd_insert(h, NULL, el, h->fd, conn_writable_status_check, NULL,
                                       conn_error_status_check, conn) < 0) {
                        PERROR("%s - Failed inserting FD event", h->module_name);
-                       connection_signal_reconnect(conn, connection_FAILED);
+                       connection_signal_reconnect(conn, CONNECTION_FAILED);
                }
                return;
        }
@@ -505,7 +505,7 @@ static void conn_status_check_again(fr_event_list_t *el, UNUSED fr_time_t now, v
 
        if (fr_event_fd_insert(h, NULL, el, h->fd, conn_writable_status_check, NULL, conn_error_status_check, conn) < 0) {
                PERROR("%s - Failed inserting FD event", h->module_name);
-               connection_signal_reconnect(conn, connection_FAILED);
+               connection_signal_reconnect(conn, CONNECTION_FAILED);
        }
 }
 
@@ -542,7 +542,7 @@ static void conn_readable_status_check(fr_event_list_t *el, UNUSED int fd, UNUSE
 
                ERROR("%s - Failed reading response from socket: %s",
                      h->module_name, fr_syserror(errno));
-               connection_signal_reconnect(conn, connection_FAILED);
+               connection_signal_reconnect(conn, CONNECTION_FAILED);
                return;
        }
 
@@ -598,7 +598,7 @@ static void conn_readable_status_check(fr_event_list_t *el, UNUSED int fd, UNUSE
                 *      Set the timer for the next retransmit.
                 */
                if (fr_event_timer_at(h, el, &u->ev, u->retry.next, conn_status_check_again, conn) < 0) {
-                       connection_signal_reconnect(conn, connection_FAILED);
+                       connection_signal_reconnect(conn, CONNECTION_FAILED);
                }
                return;
        }
@@ -642,7 +642,7 @@ static void conn_writable_status_check(fr_event_list_t *el, UNUSED int fd, UNUSE
 
        if (encode(h->inst, h->status_request, u, u->id) < 0) {
        fail:
-               connection_signal_reconnect(conn, connection_FAILED);
+               connection_signal_reconnect(conn, CONNECTION_FAILED);
                return;
        }
        DEBUG3("Encoded packet");
@@ -963,7 +963,7 @@ static void conn_discard(UNUSED fr_event_list_t *el, int fd, UNUSED int flags, v
                case ENOTCONN:
                case ETIMEDOUT:
                        ERROR("%s - Failed draining socket: %s", h->module_name, fr_syserror(errno));
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        break;
 
                default:
@@ -990,7 +990,7 @@ static void conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int fla
 
        ERROR("%s - Connection %s failed: %s", h->module_name, h->name, fr_syserror(fd_errno));
 
-       connection_signal_reconnect(conn, connection_FAILED);
+       connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
 static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
@@ -1038,7 +1038,7 @@ static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
                /*
                 *      May free the connection!
                 */
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -1080,7 +1080,7 @@ static void thread_conn_notify_replicate(trunk_connection_t *tconn, connection_t
                /*
                 *      May free the connection!
                 */
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -1462,7 +1462,7 @@ static void revive_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_t now, voi
        udp_handle_t            *h = talloc_get_type_abort(tconn->conn->h, udp_handle_t);
 
        INFO("%s - Reviving connection %s", h->module_name, h->name);
-       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
 }
 
 /** Mark a connection dead after "zombie_interval"
@@ -1488,7 +1488,7 @@ static void zombie_timeout(fr_event_list_t *el, fr_time_t now, void *uctx)
         *      then the connection will be marked "alive"
         */
        if (h->inst->parent->status_check) {
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                return;
        }
 
@@ -1498,7 +1498,7 @@ static void zombie_timeout(fr_event_list_t *el, fr_time_t now, void *uctx)
        if (fr_event_timer_at(h, el, &h->zombie_ev,
                              fr_time_add(now, h->inst->parent->revive_interval), revive_timeout, tconn) < 0) {
                ERROR("Failed inserting revive timeout for connection");
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -1567,13 +1567,13 @@ static bool check_for_zombie(fr_event_list_t *el, trunk_connection_t *tconn, fr_
 
                if (trunk_request_enqueue_on_conn(&h->status_r->treq, tconn, h->status_request,
                                                     h->status_u, h->status_r, true) != TRUNK_ENQUEUE_OK) {
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                }
        } else {
                if (fr_event_timer_at(h, el, &h->zombie_ev, fr_time_add(now, h->inst->parent->zombie_period),
                                      zombie_timeout, tconn) < 0) {
                        ERROR("Failed inserting zombie timeout for connection");
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                }
        }
 
@@ -1703,7 +1703,7 @@ static void status_check_retry(UNUSED fr_event_list_t *el, fr_time_t now, void *
         *      connection.
         */
         h->status_checking = false;
-        trunk_connection_signal_reconnect(tconn, connection_FAILED);
+        trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
 }
 
 static void request_mux(fr_event_list_t *el,
@@ -1879,7 +1879,7 @@ static void request_mux(fr_event_list_t *el,
                default:
                        ERROR("%s - Failed sending data over connection %s: %s",
                              h->module_name, h->name, fr_syserror(errno));
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        return;
                }
        }
@@ -2069,7 +2069,7 @@ static void request_mux_replicate(UNUSED fr_event_list_t *el,
                default:
                        ERROR("%s - Failed sending data over connection %s: %s",
                              h->module_name, h->name, fr_syserror(errno));
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        return;
                }
        }
@@ -2215,7 +2215,7 @@ static void status_check_next(UNUSED fr_event_list_t *el, UNUSED fr_time_t now,
 
        if (trunk_request_enqueue_on_conn(&h->status_r->treq, tconn, h->status_request,
                                             h->status_u, h->status_r, true) != TRUNK_ENQUEUE_OK) {
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -2257,7 +2257,7 @@ static void status_check_reply(trunk_request_t *treq, fr_time_t now)
                 *      Set the timer for the next retransmit.
                 */
                if (fr_event_timer_at(h, h->thread->el, &u->ev, u->retry.next, status_check_next, treq->tconn) < 0) {
-                       trunk_connection_signal_reconnect(treq->tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(treq->tconn, CONNECTION_FAILED);
                }
                return;
        }
@@ -2313,7 +2313,7 @@ static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
 
                        ERROR("%s - Failed reading response from socket: %s",
                              h->module_name, fr_syserror(errno));
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        return;
                }
 
index cf33852971057651c22a54ac454489654b7b420b..b92588fc0f0c35c90f27273088bc3fc8f0710b8b 100644 (file)
@@ -206,7 +206,7 @@ static void _sql_connect_io_notify(fr_event_list_t *el, int fd, UNUSED int flags
 connected:
        if (!c->sock) {
                ERROR("MySQL error: %s", mysql_error(&c->db));
-               connection_signal_reconnect(c->conn, connection_FAILED);
+               connection_signal_reconnect(c->conn, CONNECTION_FAILED);
                return;
        }
 
@@ -809,7 +809,7 @@ static void sql_conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int
 {
        trunk_connection_t      *tconn = talloc_get_type_abort(uctx, trunk_connection_t);
        ERROR("%s - Connection failed: %s", tconn->conn->name, fr_syserror(fd_errno));
-       connection_signal_reconnect(tconn->conn, connection_FAILED);
+       connection_signal_reconnect(tconn->conn, CONNECTION_FAILED);
 }
 
 /** Allocate an SQL trunk connection
@@ -869,7 +869,7 @@ static void sql_trunk_connection_notify(trunk_connection_t *tconn, connection_t
 
        if (fr_event_fd_insert(sql_conn, NULL, el, sql_conn->fd, read_fn, write_fn, sql_conn_error, tconn) < 0) {
                PERROR("Failed inserting FD event");
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -1057,7 +1057,7 @@ static void sql_request_cancel_mux(UNUSED fr_event_list_t *el, trunk_connection_
         */
        if ((trunk_connection_pop_cancellation(&treq, tconn)) == 0) {
                trunk_request_signal_cancel_complete(treq);
-               connection_signal_reconnect(conn, connection_FAILED);
+               connection_signal_reconnect(conn, CONNECTION_FAILED);
        }
 }
 
index 3f934a60bcf5f6ce3364ca0e651171e16ed06070..6e0dd04c3f3f96786ca3d73bbe1fec85ec02521b 100644 (file)
@@ -219,7 +219,7 @@ static void udp_request_reset(udp_handle_t *h, udp_request_t *u)
         *      Welcome to the insanity that is TACACS+.
         */
        if ((h->active == 0) && (h->id > 255)) {
-               trunk_connection_signal_reconnect(h->tconn, connection_EXPIRED);
+               trunk_connection_signal_reconnect(h->tconn, CONNECTION_EXPIRED);
        }
 }
 
@@ -459,7 +459,7 @@ static void conn_error(UNUSED fr_event_list_t *el, UNUSED int fd, UNUSED int fla
 
        ERROR("%s - Connection %s failed: %s", h->module_name, h->name, fr_syserror(fd_errno));
 
-       connection_signal_reconnect(conn, connection_FAILED);
+       connection_signal_reconnect(conn, CONNECTION_FAILED);
 }
 
 static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
@@ -499,7 +499,7 @@ static void thread_conn_notify(trunk_connection_t *tconn, connection_t *conn,
                /*
                 *      May free the connection!
                 */
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -648,7 +648,7 @@ static void revive_timeout(UNUSED fr_event_list_t *el, UNUSED fr_time_t now, voi
        udp_handle_t            *h = talloc_get_type_abort(tconn->conn->h, udp_handle_t);
 
        INFO("%s - Reviving connection %s", h->module_name, h->name);
-       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
 }
 
 /** Mark a connection dead after "zombie_interval"
@@ -674,7 +674,7 @@ static void zombie_timeout(fr_event_list_t *el, fr_time_t now, void *uctx)
        if (fr_event_timer_at(h, el, &h->zombie_ev,
                              fr_time_add(now, h->inst->parent->revive_interval), revive_timeout, h) < 0) {
                ERROR("Failed inserting revive timeout for connection");
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 }
 
@@ -735,7 +735,7 @@ static bool check_for_zombie(fr_event_list_t *el, trunk_connection_t *tconn, fr_
        if (fr_event_timer_at(h, el, &h->zombie_ev, fr_time_add(now, h->inst->parent->zombie_period),
                              zombie_timeout, h) < 0) {
                ERROR("Failed inserting zombie timeout for connection");
-               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
        }
 
        return true;
@@ -950,7 +950,7 @@ static void request_mux(fr_event_list_t *el,
                default:
                        ERROR("%s - Failed sending data over connection %s: %s",
                              h->module_name, h->name, fr_syserror(errno));
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        return;
                }
        }
@@ -1095,7 +1095,7 @@ static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
 
                                ERROR("%s - Failed reading response from socket: %s",
                                      h->module_name, fr_syserror(errno));
-                               trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                               trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                                return;
                        }
 
@@ -1126,7 +1126,7 @@ static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                if (packet_len > h->inst->max_packet_size) {
                        ERROR("%s - Packet is larger than max_packet_size",
                              h->module_name);
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        return;
                }
 
@@ -1167,7 +1167,7 @@ static void request_demux(UNUSED fr_event_list_t *el, trunk_connection_t *tconn,
                slen = decode(request->reply_ctx, &reply, &code, h, request, u, h->recv.read, packet_len);
                if (slen < 0) {
                        // @todo - give real decode error?
-                       trunk_connection_signal_reconnect(tconn, connection_FAILED);
+                       trunk_connection_signal_reconnect(tconn, CONNECTION_FAILED);
                        return;
                }
                h->recv.read += packet_len;