@@ -181,16 +181,13 @@ bool WebRTCTransportRequestorServer::IsPeerNodeSessionValid(uint16_t sessionId,
181
181
182
182
if (!existingSession)
183
183
{
184
- // If sessionId is not null and does not match a value in current sessions.
185
- ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::ConstraintError);
186
184
return false ;
187
185
}
188
186
189
187
// Also check that the existing session belongs to the same PeerNodeID / Fabric
190
- // If it doesn’t match, respond with CONSTRAINT_ERROR
188
+ // If it doesn’t match, return false
191
189
if (peerNodeId != existingSession->peerNodeID || peerFabricIndex != existingSession->GetFabricIndex ())
192
190
{
193
- ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::ConstraintError);
194
191
return false ;
195
192
}
196
193
@@ -333,8 +330,10 @@ void WebRTCTransportRequestorServer::HandleICECandidates(HandlerContext & ctx, c
333
330
334
331
// Check if the session, NodeID are valid
335
332
if (!IsPeerNodeSessionValid (sessionId, ctx))
333
+ {
334
+ ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::NotFound);
336
335
return ;
337
-
336
+ }
338
337
// Handle ICE candidates in Delegate
339
338
ctx.mCommandHandler .AddStatus (
340
339
ctx.mRequestPath , Protocols::InteractionModel::ClusterStatusCode (mDelegate .HandleICECandidates (sessionId, candidates)));
@@ -356,8 +355,10 @@ void WebRTCTransportRequestorServer::HandleEnd(HandlerContext & ctx, const Comma
356
355
357
356
// Check if the session, NodeID are valid
358
357
if (!IsPeerNodeSessionValid (sessionId, ctx))
358
+ {
359
+ ctx.mCommandHandler .AddStatus (ctx.mRequestPath , Status::NotFound);
359
360
return ;
360
-
361
+ }
361
362
// Handle End command in Delegate
362
363
ctx.mCommandHandler .AddStatus (ctx.mRequestPath ,
363
364
Protocols::InteractionModel::ClusterStatusCode (mDelegate .HandleEnd (sessionId, reason)));
0 commit comments