Skip to content

Commit e6a0c36

Browse files
committed
Prefer IPv4 by default. Use the option {prefer_ipv6, true} to force ibrowse to use ipv6 where available.
1 parent ffe3530 commit e6a0c36

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
CONTRIBUTIONS & CHANGE HISTORY
22
==============================
33

4+
21-09-2018 - v4.4.2
5+
* Fix for #163 - default to using IPv4
6+
47
23-08-2018 - v4.4.1
58
* Fixes to TLS socket handling (PR#163)
69
* Fix ipv6 address family handling (PR#155)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ibrowse is a HTTP client written in erlang.
77

88
**Comments to:** [email protected]
99

10-
**Current Version:** 4.4
10+
**Current Version:** 4.4.2
1111

1212
**Latest Version:** git://github.com/cmullaparthi/ibrowse.git
1313

src/ibrowse.app.src

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{application, ibrowse,
22
[{description, "Erlang HTTP client application"},
3-
{vsn, "4.4.1"},
3+
{vsn, "4.4.2"},
44
{registered, [ibrowse_sup, ibrowse]},
55
{applications, [kernel,stdlib]},
66
{env, []},

src/ibrowse_http_client.erl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -605,12 +605,18 @@ do_connect(Host, Port, Options, _State, Timeout) ->
605605

606606
get_sock_options(Host, Options, SSLOptions) ->
607607
Caller_socket_options = get_value(socket_options, Options, []),
608-
Ipv6Options = case is_ipv6_host(Host) of
609-
true ->
610-
[inet6];
611-
false ->
612-
[]
613-
end,
608+
PreferIPv6 = get_value(prefer_ipv6, Options, false),
609+
Ipv6Options = case PreferIPv6 of
610+
true ->
611+
case is_ipv6_host(Host) of
612+
true ->
613+
[inet6];
614+
false ->
615+
[]
616+
end;
617+
false ->
618+
[]
619+
end,
614620
Other_sock_options = filter_sock_options(SSLOptions ++ Caller_socket_options ++ Ipv6Options),
615621
case lists:keysearch(nodelay, 1, Other_sock_options) of
616622
false ->

0 commit comments

Comments
 (0)