esl / jerboa

STUN/TURN encoder, decoder and client library in Elixir
https://www.erlang-solutions.com/products/mongooseim.html
Other
14 stars 6 forks source link

Validate arguments passed to Client.* functions #95

Closed arkgil closed 7 years ago

arkgil commented 7 years ago

Right now there are not validations, so passing bad arguments results in crash of client process in most cases. We could also look into narrowing the scope of Client.ip, or create the new type for IPv4 addresses, because we don't support IPv6 TURN extension (yet?).

arkgil commented 7 years ago

Hm, I'm wondering if its worth the effort. Channels seem to be more important feature. /cc @rslota @erszcz

erszcz commented 7 years ago

create the new type for IPv4 addresses

The distinction between IPv4 and IPv6 is never going to disappear, so it's OK to resemble that in the types we use and specify which functions can operate on both (probably public / closer to the public interface) and which are specific to one of them (the underpinnings of the interface).

Regarding prioritisation, IMO specific types (visible in the function signatures) and crashes on misuse are good enough, while validation is nice, of course, but not strictly necessary.