elixir-webrtc / ex_webrtc

An Elixir implementation of the W3C WebRTC API
Apache License 2.0
269 stars 8 forks source link

Fix send_rtp for non-existing track id #114

Closed ndrean closed 3 weeks ago

ndrean commented 4 weeks ago

I did not returned a {:stop, :unrecognized_id, state} as I don't know how you want to treat this.

ndrean commented 4 weeks ago

Yes....indeed

https://github.com/elixir-webrtc/ex_webrtc/blob/cbfdc56b5d3b8f2e62cfbc832786fdd653827a16/test/ex_webrtc/peer_connection_test.exs#L953

test_send_data(pc1, pc2, track1, track1) will make it fail, but... I can't catch this :EXIT.

ndrean commented 3 weeks ago

:EXIT trapped in fact with Process.flag(:trap_exit, true). Discovered this. Seems to pass.

mickel8 commented 3 weeks ago

@ndrean thanks for your work!

I have modified a little bit the behavior so that pc doesn't stop when we try to send data on invalid track id.

I also created a separate test case for send_rtp as I belive it fits better :slightly_smiling_face:

ndrean commented 3 weeks ago

@mickel8 @LVala Thanks both of you for your work!