ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
client.c File Reference

Go to the source code of this file.

Data Structures

struct  client_dispatch_entry_t
 Hash table entry for client packet dispatch. More...
struct  server_client_removal_t

Macros

#define SERVER_CLIENT_PRETTY_BUFFER_SIZE   64
#define SERVER_OPUS_BATCH_OVERHEAD   20
#define DEBUG_NETWORK   1
#define DEBUG_THREADS   1
#define DEBUG_MEMORY   1
#define CLIENT_DISPATCH_HASH_SIZE   32
#define CLIENT_DISPATCH_HANDLER_COUNT   14
#define CLIENT_DISPATCH_HASH(type)

Typedefs

typedef void(* client_packet_handler_t) (client_info_t *client, const void *data, size_t len)

Functions

void broadcast_server_state_to_all_clients (void)
 Notify all clients of state changes.
client_info_t * find_client_by_id (const char *client_id)
 Fast O(1) client lookup by ID using hash table.
client_info_t * add_transport_client (server_context_t *server_ctx, acip_transport_t *transport, const char *client_ip)
int remove_client (server_context_t *server_ctx, const char *client_id)
asciichat_error_t server_dispatch_packet (client_info_t *client, packet_type_t type, const void *data, size_t length)
asciichat_error_t server_send_state (acip_transport_t *transport)
int start_transport_client_threads (server_context_t *server_ctx, const char *client_id)
void cleanup_client_media_buffers (client_info_t *client)
void cleanup_client_packet_queues (client_info_t *client)
void handle_image_frame_h264_packet (client_info_t *client, const void *data, size_t len)
void process_decrypted_packet (client_info_t *client, packet_type_t type, void *data, size_t len)

Variables

client_manager_t g_client_manager
 Hash table entry for client packet dispatch.
rwlock_t g_client_manager_rwlock = {0}
 Reader-writer lock protecting the global client manager.
bool g_client_manager_rwlock_initialized = false

Macro Definition Documentation

◆ CLIENT_DISPATCH_HANDLER_COUNT

#define CLIENT_DISPATCH_HANDLER_COUNT   14

Definition at line 91 of file src/server/client.c.

◆ CLIENT_DISPATCH_HASH

#define CLIENT_DISPATCH_HASH ( type)
Value:
#define CLIENT_DISPATCH_HASH_SIZE

Definition at line 101 of file src/server/client.c.

◆ CLIENT_DISPATCH_HASH_SIZE

#define CLIENT_DISPATCH_HASH_SIZE   32

Definition at line 90 of file src/server/client.c.

◆ DEBUG_MEMORY

#define DEBUG_MEMORY   1

Definition at line 82 of file src/server/client.c.

◆ DEBUG_NETWORK

#define DEBUG_NETWORK   1

Definition at line 80 of file src/server/client.c.

◆ DEBUG_THREADS

#define DEBUG_THREADS   1

Definition at line 81 of file src/server/client.c.

◆ SERVER_CLIENT_PRETTY_BUFFER_SIZE

#define SERVER_CLIENT_PRETTY_BUFFER_SIZE   64

Definition at line 3 of file src/server/client.c.

◆ SERVER_OPUS_BATCH_OVERHEAD

#define SERVER_OPUS_BATCH_OVERHEAD   20

Definition at line 6 of file src/server/client.c.

Typedef Documentation

◆ client_packet_handler_t

typedef void(* client_packet_handler_t) (client_info_t *client, const void *data, size_t len)

Definition at line 88 of file src/server/client.c.

Function Documentation

◆ add_transport_client()

client_info_t * add_transport_client ( server_context_t * server_ctx,
acip_transport_t * transport,
const char * client_ip )

Definition at line 404 of file src/server/client.c.

404 {
405 if (!server_ctx || !transport || !client_ip) {
406 SET_ERRNO(ERROR_INVALID_PARAM, "Invalid parameters");
407 return NULL;
408 }
409
410 rwlock_wrlock(&g_client_manager_rwlock);
411
412 // Find empty slot - this is the authoritative check
413 int slot = -1;
414 int existing_count = 0;
415 for (int i = 0; i < MAX_CLIENTS; i++) {
416 if (slot == -1 && g_client_manager.clients[i].client_id[0] == '\0') {
417 slot = i; // Take first available slot
418 }
419 // Count only active clients
420 if (g_client_manager.clients[i].client_id[0] != '\0' && atomic_load_bool(&g_client_manager.clients[i].active)) {
421 existing_count++;
422 }
423 }
424
425 // Check if we've hit the configured max-clients limit (not the array size)
426 if (existing_count >= GET_OPTION(max_clients)) {
427 rwlock_wrunlock(&g_client_manager_rwlock);
428 SET_ERRNO(ERROR_RESOURCE_EXHAUSTED, "Maximum client limit reached (%d/%d active clients)", existing_count, GET_OPTION(max_clients));
429 log_error("Maximum client limit reached (%d/%d active clients)", existing_count, GET_OPTION(max_clients));
430 return NULL;
431 }
432
433 if (slot == -1) {
434 rwlock_wrunlock(&g_client_manager_rwlock);
435 SET_ERRNO(ERROR_RESOURCE_EXHAUSTED, "No available client slots (all %d array slots are in use)", MAX_CLIENTS);
436 log_error("No available client slots (all %d array slots are in use)", MAX_CLIENTS);
437 return NULL;
438 }
439
440 // Update client_count to match actual count before adding new client
441 g_client_manager.client_count = existing_count;
442
443 // Generate unique client ID for transport client (noun only, without counter or port)
444 char new_client_id[MAX_CLIENT_ID_LEN];
445 if (generate_client_id(new_client_id, sizeof(new_client_id)) != 0) {
446 rwlock_wrunlock(&g_client_manager_rwlock);
447 log_error("Failed to generate unique client ID for transport client");
448 return NULL;
449 }
450
451 // Initialize client
452 client_info_t *client = &g_client_manager.clients[slot];
453
454 server_client_initialize_transport_slot(server_ctx, client, transport, new_client_id, client_ip, slot);
455
456 if (server_client_allocate_transport_buffers(client, new_client_id) != ASCIICHAT_OK || server_client_initialize_transport_sync(client, new_client_id) != ASCIICHAT_OK) {
457 goto error_cleanup_transport;
458 }
459
460 g_client_manager.client_count = existing_count + 1; // We just added a client
461 log_debug("Client count updated: now %d clients (added transport client_id=%s to slot %d)", g_client_manager.client_count, new_client_id, slot);
462
463 // Add client to uthash table for O(1) lookup
464 HASH_ADD_STR(g_client_manager.clients_by_id, client_id, client);
465 log_debug("Added transport client %s to uthash table", new_client_id);
466
467 // Release the write lock IMMEDIATELY after adding to hash table
468 // The client is fully initialized before other threads can look it up.
469 rwlock_wrunlock(&g_client_manager_rwlock);
470
471 // Register client with session_host (for discovery mode support)
472 // transport clients use INVALID_SOCKET_VALUE since they don't have a TCP socket
473 if (server_ctx->session_host) {
474 client->session_client_id = session_host_add_client(server_ctx->session_host, NULL, ACIP_TRANSPORT_BORROWED, client_ip, 0);
475 if (client->session_client_id == 0) {
476 log_warn("Failed to register transport client %s with session_host", new_client_id);
477 } else {
478 log_debug("transport client %s registered with session_host as %u", new_client_id, client->session_client_id);
479 }
480 }
481
482 // Broadcast server state to ALL clients AFTER the new client is fully set up
483 // This notifies all clients (including the new one) about the updated grid
485
486 return client;
487
488error_cleanup_transport:
489 // Clean up all partially allocated resources for transport client
490 // NOTE: This label is reached when allocation or initialization fails BEFORE
491 // the client is added to the hash table. Don't call remove_client() here.
492 cleanup_client_all_buffers(client);
493 memset(client, 0, sizeof(*client));
494 rwlock_wrunlock(&g_client_manager_rwlock);
495 return NULL;
496}
#define SET_ERRNO(code,...)
bool atomic_load_bool(atomic_t *a)
Atomic pointer wrapper.
@ ERROR_RESOURCE_EXHAUSTED
@ ASCIICHAT_OK
Definition error_codes.h:50
@ ERROR_INVALID_PARAM
#define MAX_CLIENTS
Maximum possible clients (static array size) - actual runtime limit set by –max-clients (1-128).
#define MAX_CLIENT_ID_LEN
Maximum client ID length - format: "noun.N (transport:port)" e.g., "mountain.0 (tcp:48036)".
#define log_warn(...)
Log a WARN message.
Definition log/log.h:615
#define log_error(...)
Log an ERROR message.
Definition log/log.h:628
#define log_debug(...)
Log a DEBUG message.
Definition log/log.h:589
#define GET_OPTION(field)
Definition options.h:1333
struct client_info client_info_t
uint32_t session_host_add_client(session_host_t *host, acip_transport_t *transport, acip_transport_ownership_t ownership, const char *ip, int port)
Definition host.c:1094
int generate_client_id(char *buffer, size_t buffer_size)
Generate a unique client ID (noun only, no counter or port).
Definition nouns.c:482
rwlock_t g_client_manager_rwlock
Reader-writer lock protecting the global client manager.
client_manager_t g_client_manager
Hash table entry for client packet dispatch.
void broadcast_server_state_to_all_clients(void)
Notify all clients of state changes.
session_host_t * session_host
Session host for discovery mode support.

References ACIP_TRANSPORT_BORROWED, ASCIICHAT_OK, atomic_load_bool(), broadcast_server_state_to_all_clients(), ERROR_INVALID_PARAM, ERROR_RESOURCE_EXHAUSTED, g_client_manager, g_client_manager_rwlock, generate_client_id(), GET_OPTION, log_debug, log_error, log_warn, MAX_CLIENT_ID_LEN, MAX_CLIENTS, client_info::session_client_id, server_context_t::session_host, session_host_add_client(), and SET_ERRNO.

◆ broadcast_server_state_to_all_clients()

void broadcast_server_state_to_all_clients ( void )

Notify all clients of state changes.

Definition at line 759 of file src/server/client.c.

759 {
761 return;
762 server_state_packet_t state = server_state_snapshot();
764}
void network_server_foreach(network_server_t *s, network_connection_visit_fn visit, void *context)
network_server_t * session_server_like_get_network_server(void)
bool g_client_manager_rwlock_initialized
Server state packet structure.
Definition packet.h:757

References g_client_manager_rwlock_initialized, network_server_foreach(), and session_server_like_get_network_server().

Referenced by add_transport_client(), and remove_client().

◆ cleanup_client_media_buffers()

void cleanup_client_media_buffers ( client_info_t * client)

Definition at line 782 of file src/server/client.c.

782 {
783 if (!client) {
784 SET_ERRNO(ERROR_INVALID_PARAM, "Client is NULL");
785 return;
786 }
787
788 if (client->digital_rain) {
790 client->digital_rain = NULL;
791 }
792
793 if (client->incoming_video_buffer) {
795 client->incoming_video_buffer = NULL;
796 }
797
798 if (client->incoming_audio_buffer) {
800 client->incoming_audio_buffer = NULL;
801 }
802
803 // Clean up Opus decoder
804 if (client->opus_decoder) {
806 client->opus_decoder = NULL;
807 }
808
809 // Clean up video decoder (persistent per-client decoder)
810 if (client->video_decoder_ctx) {
811 avcodec_free_context((AVCodecContext **)&client->video_decoder_ctx);
812 client->video_decoder_ctx = NULL;
813 }
814 if (client->video_decode_frame) {
815 av_frame_free((AVFrame **)&client->video_decode_frame);
816 client->video_decode_frame = NULL;
817 }
818 if (client->video_rgb_frame) {
819 av_frame_free((AVFrame **)&client->video_rgb_frame);
820 client->video_rgb_frame = NULL;
821 }
822 if (client->video_sws_ctx) {
823 sws_freeContext(client->video_sws_ctx);
824 client->video_sws_ctx = NULL;
825 }
826}
void audio_ring_buffer_destroy(audio_ring_buffer_t *rb)
Destroy an audio ring buffer.
void opus_codec_destroy(opus_codec_t *codec)
Destroy an Opus codec instance.
Definition opus.c:271
void video_frame_buffer_destroy(video_frame_buffer_t *vfb)
Destroy frame buffer and free all resources.
Definition video_frame.c:97
void digital_rain_destroy(digital_rain_t *rain)
Destroy digital rain effect context.
video_frame_buffer_t * incoming_video_buffer
audio_ring_buffer_t * incoming_audio_buffer
State for one Opus encoding or decoding direction.
Definition opus.h:105

References audio_ring_buffer_destroy(), client_info::digital_rain, digital_rain_destroy(), ERROR_INVALID_PARAM, client_info::incoming_audio_buffer, client_info::incoming_video_buffer, opus_codec_destroy(), client_info::opus_decoder, SET_ERRNO, client_info::video_decode_frame, client_info::video_decoder_ctx, video_frame_buffer_destroy(), client_info::video_rgb_frame, and client_info::video_sws_ctx.

◆ cleanup_client_packet_queues()

void cleanup_client_packet_queues ( client_info_t * client)

Definition at line 828 of file src/server/client.c.

828 {
829 if (!client)
830 return;
831
832 // Async dispatch: clean up received packet queue
833
834 // Video now uses double buffer, cleaned up in cleanup_client_media_buffers
835}

◆ find_client_by_id()

client_info_t * find_client_by_id ( const char * client_id)

Fast O(1) client lookup by ID using hash table.

This is the primary method for locating clients throughout the server. It uses a hash table for constant-time lookups regardless of client count, making it suitable for high-performance operations like rendering and stats.

PERFORMANCE CHARACTERISTICS:

  • Time Complexity: O(1) average case, O(n) worst case (hash collision)
  • Space Complexity: O(1)
  • Thread Safety: Hash table is internally thread-safe for lookups

USAGE PATTERNS:

  • Called by render threads to find target clients for frame generation
  • Used by protocol handlers to locate clients for packet processing
  • Stats collection for per-client performance monitoring
Parameters
client_idUnique identifier for the client (0 is invalid)
Returns
Pointer to client_info_t if found, NULL if not found or invalid ID
Note
Does not require external locking - hash table provides thread safety
Returns direct pointer to client struct - caller should use snapshot pattern

Definition at line 269 of file src/server/client.c.

269 {
270 if (!client_id || client_id[0] == '\0') {
271 SET_ERRNO(ERROR_INVALID_PARAM, "Invalid client ID");
272 return NULL;
273 }
274
275 // Protect uthash lookup with read lock to prevent concurrent access issues
276 rwlock_rdlock(&g_client_manager_rwlock);
277
278 client_info_t *result = NULL;
279 HASH_FIND_STR(g_client_manager.clients_by_id, client_id, result);
280
281 rwlock_rdunlock(&g_client_manager_rwlock);
282
283 if (!result) {
284 log_warn("Client not found for ID %s", client_id);
285 }
286
287 return result;
288}

References ERROR_INVALID_PARAM, g_client_manager, g_client_manager_rwlock, log_warn, and SET_ERRNO.

Referenced by start_transport_client_threads().

◆ handle_image_frame_h264_packet()

void handle_image_frame_h264_packet ( client_info_t * client,
const void * data,
size_t len )

Definition at line 1205 of file src/server/client.c.

1205 {
1206 asciichat_error_t result = acip_handle_server_packet(client->transport, PACKET_TYPE_IMAGE_FRAME_H264, data, len, client, &g_acip_server_callbacks);
1207 if (result != ASCIICHAT_OK)
1208 disconnect_client_for_bad_data(client, "Invalid H.264 packet");
1209}
asciichat_error_t
Error and exit codes - unified status values (0-255).
Definition error_codes.h:48
@ PACKET_TYPE_IMAGE_FRAME_H264
Definition packet.h:403
void disconnect_client_for_bad_data(client_info_t *client, const char *format,...)
asciichat_error_t acip_handle_server_packet(acip_transport_t *transport, packet_type_t type, const void *payload, size_t payload_len, void *client_ctx, const acip_server_callbacks_t *callbacks)
Handle incoming packet on server side.
Definition handlers.c:730

References acip_handle_server_packet(), ASCIICHAT_OK, disconnect_client_for_bad_data(), PACKET_TYPE_IMAGE_FRAME_H264, and client_info::transport.

◆ process_decrypted_packet()

void process_decrypted_packet ( client_info_t * client,
packet_type_t type,
void * data,
size_t len )

Process a decrypted packet from a client

Parameters
clientClient info structure
typePacket type
dataPacket data
lenPacket length

Definition at line 1411 of file src/server/client.c.

1411 {
1412 if (type == 5000) { // CLIENT_CAPABILITIES
1413 log_debug("CLIENT: client_id=%s, data=%p, len=%zu", client->client_id, data, len);
1414 }
1415
1416 // Rate limiting: Check and record packet-specific rate limits
1417 if (g_rate_limiter) {
1418 bool allowed = false;
1421 if (result != ASCIICHAT_OK || !allowed) {
1422 if (result == ASCIICHAT_OK)
1423 SET_ERRNO(ERROR_RATE_LIMITED, "Packet quota exceeded");
1424 LOG_ERRNO_IF_SET("Packet rate-limit enforcement rejected client");
1426 mutex_lock(&client->send_mutex);
1428 mutex_unlock(&client->send_mutex);
1429 if (sent != ASCIICHAT_OK)
1430 LOG_ERRNO_IF_SET("Could not notify client about rate-limit decision");
1432 if (result == ASCIICHAT_OK)
1434 atomic_store_bool(&client->active, false);
1435 return;
1436 }
1437 ASSERT_NO_ERRNO_SINCE(limit_scope);
1439 }
1440
1441 // O(1) dispatch via hash table lookup
1442 int idx = client_dispatch_hash_lookup(g_client_dispatch_hash, type);
1443 if (type == 5000 || type == 3001) {
1444 log_error("DISPATCH_LOOKUP: type=%d, idx=%d (len=%zu)", type, idx, len);
1445 }
1446 if (idx < 0) {
1447 disconnect_client_for_bad_data(client, "Unknown packet type: %d (len=%zu)", type, len);
1448 return;
1449 }
1450
1451 if (type == 5000 || type == 3001) {
1452 log_error("DISPATCH_HANDLER: type=%d, calling handler[%d]...", type, idx);
1453 }
1454 g_client_dispatch_handlers[idx](client, data, len);
1455 if (type == 5000 || type == 3001) {
1456 log_error("DISPATCH_HANDLER: type=%d, handler returned", type);
1457 }
1458}
void errno_scope_end(asciichat_errno_scope_t scope, asciichat_errno_outcome_t outcome)
asciichat_errno_scope_t errno_scope_begin(void)
#define ASSERT_NO_ERRNO_SINCE(scope)
@ ASCIICHAT_ERRNO_HANDLED
#define LOG_ERRNO_IF_SET(message)
void atomic_store_bool(atomic_t *a, bool value)
Atomically store a boolean value.
@ ERROR_RATE_LIMITED
Definition error_codes.h:84
@ ERROR_INTERNAL
Definition error_codes.h:91
asciichat_error_t check_and_record_packet_rate_limit(rate_limiter_t *rate_limiter, const char *client_ip, packet_type_t packet_type, bool *allowed)
Map packet type to rate event type and check rate limit.
asciichat_error_t acip_send_error(acip_transport_t *transport, uint32_t error_code, const char *message)
Send error message packet.
Definition send.c:402
rate_limiter_t * g_rate_limiter
Global rate limiter for connection attempts and packet processing.
When code needs to work with asciichat errno snapshot, it keeps total, copied here instead of scatter...
char client_ip[INET_ADDRSTRLEN]
char client_id[MAX_CLIENT_ID_LEN]

References acip_send_error(), client_info::active, ASCIICHAT_ERRNO_HANDLED, ASCIICHAT_OK, ASSERT_NO_ERRNO_SINCE, atomic_store_bool(), check_and_record_packet_rate_limit(), client_info::client_id, client_info::client_ip, disconnect_client_for_bad_data(), errno_scope_begin(), errno_scope_end(), ERROR_INTERNAL, ERROR_RATE_LIMITED, g_rate_limiter, log_debug, LOG_ERRNO_IF_SET, log_error, client_info::send_mutex, SET_ERRNO, and client_info::transport.

◆ remove_client()

int remove_client ( server_context_t * server_ctx,
const char * client_id )

Definition at line 687 of file src/server/client.c.

687 {
688 if (!server_ctx) {
689 SET_ERRNO(ERROR_INVALID_PARAM, "Cannot remove client %s: NULL server_ctx", client_id);
690 return -1;
691 }
692
693 server_client_removal_t removal = {0};
694 if (server_client_begin_removal(server_ctx, client_id, &removal) != ASCIICHAT_OK) {
695 return -1;
696 }
697 if (!removal.client) {
698 return 0; // Another thread is already removing this client.
699 }
700
702 return -1;
703 if (!server_client_finish_removal(client_id, &removal)) {
704 return 0;
705 }
706
708 return 0;
709}
asciichat_error_t stop_client_render_threads(client_info_t *client)
Stop and cleanup per-client rendering threads.

References ASCIICHAT_OK, broadcast_server_state_to_all_clients(), server_client_removal_t::client, ERROR_INVALID_PARAM, SET_ERRNO, and stop_client_render_threads().

◆ server_dispatch_packet()

asciichat_error_t server_dispatch_packet ( client_info_t * client,
packet_type_t type,
const void * data,
size_t length )

Definition at line 719 of file src/server/client.c.

719 {
721 return handle_runtime_settings(client, data, length);
722 return acip_handle_server_packet(client->transport, type, data, length, client, &g_acip_server_callbacks);
723}
@ PACKET_TYPE_ACIP_SETTINGS_SYNC
Settings sync (Initiator -> Host -> All Participants).
Definition packet.h:499
asciichat_error_t handle_runtime_settings(client_info_t *client, const void *data, size_t length)

References acip_handle_server_packet(), handle_runtime_settings(), PACKET_TYPE_ACIP_SETTINGS_SYNC, and client_info::transport.

◆ server_send_state()

asciichat_error_t server_send_state ( acip_transport_t * transport)

Definition at line 755 of file src/server/client.c.

755 {
756 server_state_packet_t state = server_state_snapshot();
757 return acip_send_server_state(transport, &state);
758}
asciichat_error_t acip_send_server_state(acip_transport_t *transport, const server_state_packet_t *state)
Send server state update to client (server → client).

References acip_send_server_state().

◆ start_transport_client_threads()

int start_transport_client_threads ( server_context_t * server_ctx,
const char * client_id )

Definition at line 766 of file src/server/client.c.

766 {
767 if (!server_ctx) {
768 SET_ERRNO(ERROR_INVALID_PARAM, "Server context is NULL");
769 return -1;
770 }
771
772 client_info_t *client = find_client_by_id(client_id);
773 if (!client) {
774 SET_ERRNO(ERROR_NOT_FOUND, "Client %s not found", client_id);
775 return -1;
776 }
777
778 log_debug("Starting application workers for client %s...", client_id);
779 return start_client_threads(server_ctx, client);
780}
@ ERROR_NOT_FOUND
client_info_t * find_client_by_id(const char *client_id)
Fast O(1) client lookup by ID using hash table.

References ERROR_INVALID_PARAM, ERROR_NOT_FOUND, find_client_by_id(), log_debug, and SET_ERRNO.

Variable Documentation

◆ g_client_manager

client_manager_t g_client_manager

Hash table entry for client packet dispatch.

Global client manager.

Global client manager singleton - central coordination point

This is the primary data structure for managing all connected clients. It serves as the bridge between main.c's connection accept loop and the per-client threading architecture.

STRUCTURE COMPONENTS:

  • clients[]: Array backing storage for client_info_t structs
  • client_hashtable: O(1) lookup table for client_id -> client_info_t*
  • client_count: Current number of active clients
  • mutex: Legacy mutex (mostly replaced by rwlock)
  • next_client_id: Monotonic counter for unique client identification

THREAD SAFETY: Protected by g_client_manager_rwlock for concurrent access

Definition at line 192 of file src/server/client.c.

Referenced by add_transport_client(), any_clients_sending_video(), find_client_by_id(), send_server_state_to_client(), server_main(), and stats_logger_thread().

◆ g_client_manager_rwlock

rwlock_t g_client_manager_rwlock = {0}

Reader-writer lock protecting the global client manager.

Read-write lock protecting client manager.

This lock enables high-performance concurrent access patterns:

  • Multiple threads can read client data simultaneously (stats, rendering)
  • Only one thread can modify client data at a time (add/remove operations)
  • Eliminates contention between read-heavy operations

USAGE PATTERN:

  • Read operations: rwlock_rdlock() for client lookups, stats gathering
  • Write operations: rwlock_wrlock() for add_transport_client(), remove_client()
  • Always acquire THIS lock before per-client mutexes (lock ordering)

Definition at line 207 of file src/server/client.c.

207{0};

Referenced by add_transport_client(), find_client_by_id(), server_main(), and stats_logger_thread().

◆ g_client_manager_rwlock_initialized

bool g_client_manager_rwlock_initialized = false

Track whether g_client_manager_rwlock was successfully initialized.

Definition at line 210 of file src/server/client.c.

Referenced by broadcast_server_state_to_all_clients().