elixir-webrtc / ex_webrtc

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

Handle incoming data before receiving an answer #95

Closed LVala closed 3 months ago

LVala commented 3 months ago

This PR makes it possible to receive data (e.g. DTLS handshake packets) from the remote peer before receiving an answer.

Now:

  1. Our ICE implementation allows data from unauthorised peer (so before we receive their credentials in an answer),
  2. DTLS requires remote's certs to perform the handshake.

DTLSTransport will now buffer packets received before receiving an answer and handle them after the transport has been initialised (so after answer has been set).

codecov[bot] commented 3 months ago

Codecov Report

Merging #95 (5cbd8d7) into master (87b58f8) will increase coverage by 0.09%. The diff coverage is 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #95 +/- ## ========================================== + Coverage 88.40% 88.49% +0.09% ========================================== Files 32 32 Lines 1561 1565 +4 ========================================== + Hits 1380 1385 +5 + Misses 181 180 -1 ``` | [Files](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/95?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc) | Coverage Δ | | |---|---|---| | [lib/ex\_webrtc/dtls\_transport.ex](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/95?src=pr&el=tree&filepath=lib%2Fex_webrtc%2Fdtls_transport.ex&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc#diff-bGliL2V4X3dlYnJ0Yy9kdGxzX3RyYW5zcG9ydC5leA==) | `83.19% <100.00%> (+1.45%)` | :arrow_up: | | [lib/ex\_webrtc/peer\_connection.ex](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/95?src=pr&el=tree&filepath=lib%2Fex_webrtc%2Fpeer_connection.ex&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc#diff-bGliL2V4X3dlYnJ0Yy9wZWVyX2Nvbm5lY3Rpb24uZXg=) | `85.32% <100.00%> (ø)` | | ------ [Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/95?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc). > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc) > `Δ = absolute (impact)`, `ø = not affected`, `? = missing data` > Powered by [Codecov](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/95?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc). Last update [87b58f8...5cbd8d7](https://app.codecov.io/gh/elixir-webrtc/ex_webrtc/pull/95?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=elixir-webrtc).