Skip to content

Commit

Permalink
Apply requested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
LVala committed Nov 7, 2023
1 parent 6fda934 commit 66f3c1b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions lib/ex_webrtc/dtls_transport.ex
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ defmodule ExWebRTC.DTLSTransport do
{:handshake_finished, keying_material, packets} ->
Logger.debug("DTLS handshake finished")
ICEAgent.send_data(dtls.ice_agent, packets)
# TODO: validate fingerprint
dtls = setup_srtp(dtls, keying_material)
{:ok, %__MODULE__{dtls | finished: true}}

Expand All @@ -132,11 +133,8 @@ defmodule ExWebRTC.DTLSTransport do
{:ok, payload} ->
{:ok, dtls, payload}

{:error, reason} = err when reason in [:reply_old, :reply_fail] ->
{:error, _reason} = err ->
err

{:error, reason} ->
raise "Couldn't unprotect SRTP packet, reason: #{inspect(reason)}"
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ex_webrtc/peer_connection.ex
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ defmodule ExWebRTC.PeerConnection do
{:noreply, %__MODULE__{state | dtls_transport: dtls}}

{:error, reason} ->
Logger.warning("Unable to process data, reason: #{inspect(reason)}")
Logger.error("Unable to process data, reason: #{inspect(reason)}")
{:noreply, state}
end
end
Expand Down

0 comments on commit 66f3c1b

Please sign in to comment.