aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2019-02-04 11:56:40 +0100
committerPéter Dimitrov <[email protected]>2019-02-04 11:56:40 +0100
commit4bdbb313f621d54038a9c17c6d9895650d539eab (patch)
treeaf62ecd980b7ae1a5a0989fa6f3edddfe06f2199 /lib/inets/src
parent784fb8d859fe3277435c8046b55a65a80313c6f5 (diff)
parent92704cd85673cca525e772d3ef8118925b86ef8c (diff)
downloadotp-4bdbb313f621d54038a9c17c6d9895650d539eab.tar.gz
otp-4bdbb313f621d54038a9c17c6d9895650d539eab.tar.bz2
otp-4bdbb313f621d54038a9c17c6d9895650d539eab.zip
Merge branch 'maint'
* maint: Fix typo in erlang.xml inets: Ignore bracket option in format_address Change-Id: I8a215d3872ae74e08d7a17b70ba53535947c032f
Diffstat (limited to 'lib/inets/src')
-rw-r--r--lib/inets/src/http_client/httpc_handler.erl12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl
index 8b356d8026..8d443a1477 100644
--- a/lib/inets/src/http_client/httpc_handler.erl
+++ b/lib/inets/src/http_client/httpc_handler.erl
@@ -805,12 +805,11 @@ handle_unix_socket_options(#request{unix_socket = UnixSocket},
error({badarg, [{ipfamily, Else}, {unix_socket, UnixSocket}]})
end.
-connect_and_send_first_request(Address, #request{ipv6_host_with_brackets = HasBrackets} = Request,
- #state{options = Options0} = State) ->
+connect_and_send_first_request(Address, Request, #state{options = Options0} = State) ->
SocketType = socket_type(Request),
ConnTimeout = (Request#request.settings)#http_options.connect_timeout,
Options = handle_unix_socket_options(Request, Options0),
- case connect(SocketType, format_address(Address, HasBrackets), Options, ConnTimeout) of
+ case connect(SocketType, format_address(Address), Options, ConnTimeout) of
{ok, Socket} ->
ClientClose =
httpc_request:is_client_closing(
@@ -1739,9 +1738,8 @@ update_session(ProfileName, #session{id = SessionId} = Session, Pos, Value) ->
{stacktrace, Stacktrace}]}}
end.
-
-format_address({Host, Port}, true) when is_list(Host)->
- {ok, Address} = inet:parse_address(string:strip(string:strip(Host, right, $]), left, $[)),
+format_address({[$[|T], Port}) ->
+ {ok, Address} = inet:parse_address(string:strip(T, right, $])),
{Address, Port};
-format_address(HostPort, _) ->
+format_address(HostPort) ->
HostPort.