COPY_FIELD(server_cs);
COPY_FIELD(cs);
COPY_FIELD(proto);
+ COPY_FIELD(active);
COPY_FIELD(use_connected);
client->state = PR_CLIENT_CONNECTED;
- radclient->active = true;
-
/*
* Connections can't spawn new connections.
*/
FR_EVENT_FILTER_IO, resume_read);
}
+ connection->parent->radclient->active = true;
+ fr_assert(connection->parent->state == PR_CLIENT_PENDING);
+ connection->parent->state = PR_CLIENT_DYNAMIC;
+
+ connection->parent->radclient->secret = talloc_strdup(connection->parent->radclient,
+ radclient->secret);
+
+ /*
+ * The client has been allowed.
+ */
+ client->state = PR_CLIENT_DYNAMIC;
+ client->radclient->active = true;
goto finish;
}
MEM(client->ht = fr_hash_table_alloc(client, connection_hash, connection_cmp, NULL));
} else {
+ if (connection) {
+ connection->parent->radclient->active = true;
+ fr_assert(connection->parent->state == PR_CLIENT_PENDING);
+ connection->parent->state = PR_CLIENT_DYNAMIC;
+
+ connection->parent->radclient->secret = talloc_strdup(connection->parent->radclient,
+ radclient->secret);
+ }
+
/*
* The client has been allowed.
*/
* Create the trie of clients for this socket.
*/
MEM(thread->trie = fr_trie_alloc(thread, NULL, NULL));
- MEM(thread->alive_clients = fr_heap_alloc(thread, alive_client_cmp,
- fr_io_client_t, alive_id, 0));
+
+ if (inst->dynamic_clients) {
+ MEM(thread->alive_clients = fr_heap_alloc(thread, alive_client_cmp,
+ fr_io_client_t, alive_id, 0));
+ }
/*
* Set the listener to call our master trampoline function.