ascii-chat
Binary v0.15.83-53-gb711d8720
Library lib/v0.3.2-701-gb711d8720
Video chat in your terminal
Loading...
Searching...
No Matches
session.h File Reference

Go to the source code of this file.

Data Structures

struct  participant_t
 Host migration state for collecting HOST_LOST packets. More...
struct  host_lost_candidate_t
 Host migration state for collecting HOST_LOST packets. More...
struct  session_entry
 Persisted discovery-session record used to admit and route participants. More...

Typedefs

typedef struct session_entry session_entry_t
 Persisted discovery-session record used to admit and route participants.

Functions

void session_entry_destroy (session_entry_t *entry)
 Free a session entry and all its resources.

Typedef Documentation

◆ session_entry_t

Persisted discovery-session record used to admit and route participants.

It stores the human-readable session string and UUID, host identity, capabilities and participant counts, password and IP-disclosure policy, session type, and creation/activity expiry timestamps. The database owns the durable record; callers use it as a validated value when loading or updating a session.

Function Documentation

◆ session_entry_destroy()

void session_entry_destroy ( session_entry_t * entry)

Free a session entry and all its resources.

Parameters
entrySession entry to free

Definition at line 15 of file lib/discovery/session.c.

15 {
16 if (!entry) {
17 return;
18 }
19
20 // Free all participants
21 for (size_t i = 0; i < MAX_SESSION_PARTICIPANTS; i++) {
22 if (entry->participants[i]) {
23 SAFE_FREE(entry->participants[i]);
24 }
25 }
26
27 // Free the entry itself
28 SAFE_FREE(entry);
29}
#define SAFE_FREE(ptr)
Definition common.h:377
#define MAX_SESSION_PARTICIPANTS
participant_t * participants[128]
Participant array (in-memory only).

References MAX_SESSION_PARTICIPANTS, session_entry::participants, and SAFE_FREE.

Referenced by acds_send_current_host(), database_session_join(), signaling_broadcast(), signaling_relay_ice(), and signaling_relay_sdp().