benoitc/hackney — pull request #110 by awetzel (2014-06-02 15:33:04+00:00)
Title: working ipv6 : allow single atom opt and inet6 in particular

Hi Benoit :)
When I try to connect to an ipv6 host with hackney, I currently get the exception :

{function_clause,
[{hackney_util,filter_options,
[[inet6],
[linger,nodelay,keepalive,send_timeout,
send_timeout_close,raw],
[binary,
{active,false},
{packet,raw},
{nodelay,true}]],
[{file,"src/hackney_util.erl"},{line,21}]},
{hackney_tcp_transport,connect,4,
[{file,"src/hackney_tcp_transport.erl"},
{line,32}]},
{hackney_connect,do_connect,4,
[{file,"src/hackney_connect.erl"},{line,214}]},
{hackney_connect,connect,5,
[{file,"src/hackney_connect.erl"},{line,30}]}

So I made two little changes in order to make hackney working with ipv6 :

- add single atom option management in `hackney_util:filter_options`
- add inet6 in accepted options of ssl and tcp sockets.