From 66f3c1b471dfcfb77abaa33bf9d800051ce5d0df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Wala?= Date: Tue, 7 Nov 2023 08:40:21 +0100 Subject: [PATCH] Apply requested changes --- lib/ex_webrtc/dtls_transport.ex | 6 ++---- lib/ex_webrtc/peer_connection.ex | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/ex_webrtc/dtls_transport.ex b/lib/ex_webrtc/dtls_transport.ex index eeffd763..39d1d2fa 100644 --- a/lib/ex_webrtc/dtls_transport.ex +++ b/lib/ex_webrtc/dtls_transport.ex @@ -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}} @@ -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 diff --git a/lib/ex_webrtc/peer_connection.ex b/lib/ex_webrtc/peer_connection.ex index 7d4692eb..acb8fdb9 100644 --- a/lib/ex_webrtc/peer_connection.ex +++ b/lib/ex_webrtc/peer_connection.ex @@ -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