|
ascii-chat 0.8.38
Real-time terminal-based video chat with ASCII art conversion
|
🚀 Server initialization, signal handling, and connection management More...
Files | |
| file | main.c |
| 🖥️ Server main entry point: multi-client connection manager with per-client rendering threads (60fps video + 172fps audio) | |
| file | main.h |
| ascii-chat Server Mode Entry Point Header | |
Data Structures | |
| struct | server_context_t |
| Server context - encapsulates all server state. More... | |
Typedefs | |
| typedef struct server_context_t | server_context_t |
| Server context - encapsulates all server state. | |
Variables | |
| bool | g_server_encryption_enabled = false |
| Global flag indicating if server encryption is enabled. | |
| private_key_t | g_server_private_key = {0} |
| Global server private key (first identity key, for backward compatibility) | |
| private_key_t | g_server_identity_keys [MAX_IDENTITY_KEYS] = {0} |
| Global server identity keys array (multi-key support) | |
| size_t | g_num_server_identity_keys = 0 |
| Number of loaded server identity keys. | |
| public_key_t | g_client_whitelist [MAX_CLIENTS] = {0} |
| Global client public key whitelist. | |
| size_t | g_num_whitelisted_clients = 0 |
| Number of whitelisted clients. | |
🚀 Server initialization, signal handling, and connection management
| typedef struct server_context_t server_context_t |
#include <main.h>
Server context - encapsulates all server state.
This structure holds all server-wide state that was previously stored in global variables. It's passed to client handlers via tcp_server user_data, reducing global state and improving modularity.
| public_key_t g_client_whitelist[MAX_CLIENTS] = {0} |
#include <main.c>
Global client public key whitelist.
Whitelist of allowed client public keys.
Array of public keys for clients that are authorized to connect to the server. Used for client authentication when whitelist mode is enabled. Sized to hold up to MAX_CLIENTS entries.
Definition at line 505 of file server/main.c.
Referenced by server_crypto_handshake(), and server_main().
| size_t g_num_server_identity_keys = 0 |
#include <main.c>
Number of loaded server identity keys.
Number of server identity keys in use.
Tracks how many identity keys were successfully loaded from –key flags. Zero means server is running in simple mode (no identity key).
Definition at line 492 of file server/main.c.
Referenced by server_crypto_handshake().
| size_t g_num_whitelisted_clients = 0 |
#include <main.c>
Number of whitelisted clients.
Tracks the current number of entries in g_client_whitelist that are valid and active. Used to iterate the whitelist and check authorization.
Definition at line 515 of file server/main.c.
Referenced by server_crypto_handshake(), and server_main().
#include <main.c>
Global flag indicating if server encryption is enabled.
Server encryption enabled flag.
Set to true when the server is configured to use encryption and has successfully loaded a private key. Controls whether the server performs cryptographic handshakes with clients.
Definition at line 456 of file server/main.c.
Referenced by server_crypto_handshake(), and server_main().
| private_key_t g_server_identity_keys[MAX_IDENTITY_KEYS] = {0} |
#include <main.c>
Global server identity keys array (multi-key support)
Array of server identity keys.
Stores all server identity keys loaded from multiple –key flags. Enables servers to present different keys (SSH, GPG) based on client expectations. Server selects the appropriate key during handshake based on what the client downloaded from ACDS.
Definition at line 482 of file server/main.c.
Referenced by server_crypto_handshake().
| private_key_t g_server_private_key = {0} |
#include <main.c>
Global server private key (first identity key, for backward compatibility)
Server's private key.
Stores the server's primary private key loaded from the first –key flag. Used for cryptographic handshakes and packet encryption/decryption. Initialized during server startup from the configured key file path.
Definition at line 469 of file server/main.c.
Referenced by server_crypto_handshake(), and server_main().