diff --git a/README.md b/README.md index 972d477..09ab178 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ as WebRTC multiplexes traffic on a single socket but PRs are welcomed ```elixir def deps do [ - {:ex_ice, "~> 0.8.5"} + {:ex_ice, "~> 0.9.0"} ] end ``` diff --git a/lib/ex_ice/priv/candidate/relay.ex b/lib/ex_ice/priv/candidate/relay.ex index 9a91af6..aea70f2 100644 --- a/lib/ex_ice/priv/candidate/relay.ex +++ b/lib/ex_ice/priv/candidate/relay.ex @@ -84,6 +84,11 @@ defmodule ExICE.Priv.Candidate.Relay do cand = %{cand | client: client} {:ok, cand} + {:send, dst, data, client} -> + # this might happen when we receive stale nonce response + cand = %{cand | client: client} + do_send(cand, dst, data) + {:data, {src_ip, src_port}, data, client} -> cand = %{cand | client: client} {:ok, src_ip, src_port, data, cand} diff --git a/lib/ex_ice/priv/ice_agent.ex b/lib/ex_ice/priv/ice_agent.ex index a40857f..cd477e2 100644 --- a/lib/ex_ice/priv/ice_agent.ex +++ b/lib/ex_ice/priv/ice_agent.ex @@ -825,7 +825,8 @@ defmodule ExICE.Priv.ICEAgent do {:send, dst, data, client} -> cand = %{cand | client: client} ice_agent = put_in(ice_agent.local_cands[cand.base.id], cand) - {_result, ice_agent} = do_send(ice_agent, cand, dst, data) + # we can't use do_send here as it will try to create permission for the turn address + :ok = ice_agent.transport_module.send(cand.base.socket, dst, data) ice_agent {:error, _reason, client} -> diff --git a/mix.exs b/mix.exs index a9444de..c6f2b59 100644 --- a/mix.exs +++ b/mix.exs @@ -1,7 +1,7 @@ defmodule ExICE.MixProject do use Mix.Project - @version "0.8.5" + @version "0.9.0" @source_url "https://github.com/elixir-webrtc/ex_ice" def project do @@ -51,7 +51,7 @@ defmodule ExICE.MixProject do defp deps do [ {:ex_stun, "~> 0.2.0"}, - {:ex_turn, "~> 0.1.0"}, + {:ex_turn, "~> 0.2.0"}, {:elixir_uuid, "~> 1.0"}, {:excoveralls, "~> 0.15", only: :test, runtime: false}, {:ex_doc, "~> 0.27", only: :dev, runtime: false}, diff --git a/mix.lock b/mix.lock index 3eb2f0b..d6fbd93 100644 --- a/mix.lock +++ b/mix.lock @@ -7,7 +7,7 @@ "erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"}, "ex_doc": {:hex, :ex_doc, "0.35.1", "de804c590d3df2d9d5b8aec77d758b00c814b356119b3d4455e4b8a8687aecaf", [:mix], [{:earmark_parser, "~> 1.4.39", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "2121c6402c8d44b05622677b761371a759143b958c6c19f6558ff64d0aed40df"}, "ex_stun": {:hex, :ex_stun, "0.2.0", "feb1fc7db0356406655b2a617805e6c712b93308c8ea2bf0ba1197b1f0866deb", [:mix], [], "hexpm", "1e01ba8290082ccbf37acaa5190d1f69b51edd6de2026a8d6d51368b29d115d0"}, - "ex_turn": {:hex, :ex_turn, "0.1.1", "e796b6c27aaf39e24ab9bad2044b426ed41ecc5ee8515087fe64f8ec9967e41b", [:mix], [{:ex_stun, "~> 0.2.0", [hex: :ex_stun, repo: "hexpm", optional: false]}], "hexpm", "832f2bba6f200a859e14cb8658b0932f841b0cf290491cca10cccf5367152547"}, + "ex_turn": {:hex, :ex_turn, "0.2.0", "4e1f9b089e9a5ee44928d12370cc9ea7a89b84b2f6256832de65271212eb80de", [:mix], [{:ex_stun, "~> 0.2.0", [hex: :ex_stun, repo: "hexpm", optional: false]}], "hexpm", "08e884f0af2c4a147e3f8cd4ffe33e3452a256389f0956e55a8c4d75bf0e74cd"}, "excoveralls": {:hex, :excoveralls, "0.18.3", "bca47a24d69a3179951f51f1db6d3ed63bca9017f476fe520eb78602d45f7756", [:mix], [{:castore, "~> 1.0", [hex: :castore, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "746f404fcd09d5029f1b211739afb8fb8575d775b21f6a3908e7ce3e640724c6"}, "file_system": {:hex, :file_system, "1.0.1", "79e8ceaddb0416f8b8cd02a0127bdbababe7bf4a23d2a395b983c1f8b3f73edd", [:mix], [], "hexpm", "4414d1f38863ddf9120720cd976fce5bdde8e91d8283353f0e31850fa89feb9e"}, "jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},