Skip to content
This repository has been archived by the owner on Dec 17, 2021. It is now read-only.

Commit

Permalink
Force TCP for DNS lookups
Browse files Browse the repository at this point in the history
...to enable responses larger than a UDP datagram size.

If a domain name resolves to multiple addresses,
it might be the case that the DNS server will return only a subset of them.
If we do the lookup via TCP, the server seems to return all of them,
not just a subset.
  • Loading branch information
erszcz committed Jul 13, 2018
1 parent 2e23d18 commit d447ab0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/claws_xmpp_comp.erl
Expand Up @@ -89,7 +89,7 @@ resolve_hosts(Name) ->
resolve_hosts(Name, a).

resolve_hosts(Name, Type) ->
[inet:ntoa(X) || X <- inet_res:lookup(Name, any, Type)].
[inet:ntoa(X) || X <- inet_res:lookup(Name, any, Type, [{usevc, true}])].

select_host(Name, Pref) ->
select_host(Name, resolve_hosts(Name), Pref).
Expand Down

0 comments on commit d447ab0

Please sign in to comment.