-
Notifications
You must be signed in to change notification settings - Fork 7
[V2] dns: use getbyname #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@tsloughter I'd appreciate if you could look over this, given you're more Erlang-y than me |
| %% so we just catch the error and return an unknown error. I'm not sure | ||
| %% what causes these. | ||
| lookup(Name, Type, Timeout) when is_binary(Name) -> | ||
| try lookup_throws(Name, Type, Timeout) of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waaa!? Well this is good to know, thanks :)
src/barnacle_ffi.erl
Outdated
| end. | ||
|
|
||
| lookup_throws(Name, Type, Timeout) when is_binary(Name) -> | ||
| io:format("Name: ~p~n", [Name]), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| io:format("Name: ~p~n", [Name]), |
Think you left this my mistake.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
| Ok(list.concat([a_records, aaaa_records])) | ||
| } | ||
|
|
||
| fn format_ip_address(ip: IpAddress) -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you do this in Gleam instead of calling inet:ntoa/1 to avoid going back to an Erlang tuple and external ffi?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mostly didn't know that function existed, but I like to keep things in Gleam where possible.
Fixes #3