Add buffering as an active state.

This commit is contained in:
SergeantPanda 2025-06-25 17:01:21 -05:00
parent c44c380bb2
commit c04ca0a804

View file

@ -472,7 +472,7 @@ class ProxyServer:
if b'state' in metadata:
state = metadata[b'state'].decode('utf-8')
active_states = [ChannelState.INITIALIZING, ChannelState.CONNECTING,
ChannelState.WAITING_FOR_CLIENTS, ChannelState.ACTIVE]
ChannelState.WAITING_FOR_CLIENTS, ChannelState.ACTIVE, ChannelState.BUFFERING]
if state in active_states:
logger.info(f"Channel {channel_id} already being initialized with state {state}")
# Create buffer and client manager only if we don't have them
@ -689,7 +689,8 @@ class ProxyServer:
owner = metadata.get(b'owner', b'').decode('utf-8')
# States that indicate the channel is running properly
valid_states = [ChannelState.ACTIVE, ChannelState.WAITING_FOR_CLIENTS, ChannelState.CONNECTING]
valid_states = [ChannelState.ACTIVE, ChannelState.WAITING_FOR_CLIENTS,
ChannelState.CONNECTING, ChannelState.BUFFERING, ChannelState.INITIALIZING]
# If the channel is in a valid state, check if the owner is still active
if state in valid_states: