Discard unneeded messages based on their "sid" parameter

If a message includes a "sid" parameter and it does not match the one
from the publisher or the subscriber the message is ignored. However, if
the message does not include a "sid" parameter it is processed just like
before for backwards compatibility.

Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
This commit is contained in:
Daniel Calviño Sánchez
2022-04-27 11:14:59 +02:00
parent 27989752bf
commit e86baba54d
4 changed files with 24 additions and 3 deletions
+2
View File
@@ -789,6 +789,7 @@ func (s *ProxyServer) processPayload(ctx context.Context, client *ProxyClient, s
case "candidate":
mcuData = &signaling.MessageClientMessageData{
Type: payload.Type,
Sid: payload.Sid,
Payload: payload.Payload,
}
case "endOfCandidates":
@@ -807,6 +808,7 @@ func (s *ProxyServer) processPayload(ctx context.Context, client *ProxyClient, s
case "sendoffer":
mcuData = &signaling.MessageClientMessageData{
Type: payload.Type,
Sid: payload.Sid,
}
default:
session.sendMessage(message.NewErrorServerMessage(UnsupportedPayload))