benoitc / hackney

simple HTTP client in Erlang
Other
1.34k stars 427 forks source link

DNS lookups with connection pooling #731

Open chrooti opened 1 year ago

chrooti commented 1 year ago

When a connection is reused due to pooling it will still do a DNS lookup via the is_ipv6 function while calling connect_options inside the checkout. I don't know if this is intentional or not.

A fix would probably involve having the output of connect_options both include inet in the ipv4 case and modify the cached client here, I can try my hand at it if that's confirmed.

Until this is fixed/if this is not a bug, a workaround is adding to the options a field connect_options: [:inet].