Skip to content

Commit cfbaa74

Browse files
Fix panic when ICE Restart RPC fails (#420)
1 parent 57666d0 commit cfbaa74

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/service/process_manager.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ func (p *process) DeleteWHIPResource(ctx context.Context, req *rpc.DeleteWHIPRes
290290
}
291291

292292
func (p *process) ICERestartWHIPResource(ctx context.Context, req *rpc.ICERestartWHIPResourceRequest) (*rpc.ICERestartWHIPResourceResponse, error) {
293-
return &rpc.ICERestartWHIPResourceResponse{}, nil
293+
return &rpc.ICERestartWHIPResourceResponse{}, psrpc.NewErrorf(psrpc.UnprocessableEntity, "Trickle-ICE and ICE restart not supported")
294294
}
295295

296296
func (p *process) WHIPRTCConnectionNotify(ctx context.Context, req *rpc.WHIPRTCConnectionNotifyRequest) (*google_protobuf2.Empty, error) {

pkg/whip/server.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,9 @@ func (s *WHIPServer) Start(
220220
RawTrickleIceSdpfrag: string(body),
221221
IfMatch: r.Header.Get("If-Match"),
222222
}, psrpc.WithRequestTimeout(5*time.Second))
223-
if err == psrpc.ErrNoResponse {
223+
if err != nil {
224224
s.handleError(err, w)
225-
logger.Infow("WHIP ICE Restart failed no such session", "error", err, "streamKey", streamKey, "resourceID", resourceID)
225+
logger.Infow("WHIP ICE restart failed", "error", err, "streamKey", streamKey, "resourceID", resourceID)
226226
return
227227
}
228228

0 commit comments

Comments
 (0)