[client] transport: stop after guest sessions end

Track unexpected loss of an admitted fallback independently from normal
stop and UUID revocation. Terminate once both primary and fallback
sessions have disappeared, regardless of notification order.

Make shutdown terminal so concurrent disconnect handling cannot replace
it with restart or running state.
This commit is contained in:
Geoffrey McRae
2026-08-12 12:13:48 +10:00
parent 2d96ec401c
commit 8fb3c4d9f6
7 changed files with 141 additions and 33 deletions

View File

@@ -34,16 +34,10 @@
#include "common/ll.h"
#include "cimgui.h"
#include "app.h"
#include "interface/transport.h"
#include "transport_fallback.h"
enum RunState
{
APP_STATE_RUNNING,
APP_STATE_RESTART,
APP_STATE_SHUTDOWN
};
enum MicDefaultState {
MIC_DEFAULT_PROMPT,
MIC_DEFAULT_ALLOW,
@@ -112,6 +106,7 @@ struct AppState
bool videoGeometryDirty;
atomic_bool fallbackUUIDMismatch;
atomic_uint transportLost;
uint8_t guestUUID[16];
bool guestUUIDValid;
@@ -359,18 +354,6 @@ extern struct AppState g_state;
extern struct CursorState g_cursor;
extern struct AppParams g_params;
static inline enum RunState app_getState(void)
{
extern _Atomic(enum RunState) p_appState;
return atomic_load_explicit(&p_appState, memory_order_acquire);
}
static inline void app_setState(enum RunState state)
{
extern _Atomic(enum RunState) p_appState;
atomic_store_explicit(&p_appState, state, memory_order_release);
}
int main_cursorThread(void * unused);
int main_frameThread(void * unused);