mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
webrtc/signalling: Give a helpful error when starting a double-session
If the peer is already in a session and tries to start a new one, give them a helpful error. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/2460>
This commit is contained in:
parent
1e5abde7b1
commit
7fd8e4001c
1 changed files with 7 additions and 1 deletions
|
@ -161,7 +161,13 @@ class WebRTCSimpleServer(object):
|
|||
if callee_id not in self.peers:
|
||||
await ws.send('ERROR peer {!r} not found'.format(callee_id))
|
||||
continue
|
||||
if self.peers[callee_id][2] is not None:
|
||||
if peer_status is not None:
|
||||
await ws.send('ERROR you are already in a session, reconnect '
|
||||
'to the server to start a new session, or use'
|
||||
'a ROOM for multi-peer sessions')
|
||||
continue
|
||||
callee_status = self.peers[callee_id][2]
|
||||
if callee_status is not None:
|
||||
await ws.send('ERROR peer {!r} busy'.format(callee_id))
|
||||
continue
|
||||
await ws.send('SESSION_OK')
|
||||
|
|
Loading…
Reference in a new issue