diff options
author | Micael Karlberg <[email protected]> | 2012-03-06 11:31:32 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-03-06 11:31:32 +0100 |
commit | c864dc812dc853e101714185b56295a3f314ed01 (patch) | |
tree | 0a6533931209b7efcf8ab0770710deb78fab4a7a /lib/inets/src/http_client/httpc_handler.erl | |
parent | 725032aabda06c77934b461374b8657963f4ff1c (diff) | |
parent | 66288284701787c7b9e1775ec9bc91732c87f51d (diff) | |
download | otp-c864dc812dc853e101714185b56295a3f314ed01.tar.gz otp-c864dc812dc853e101714185b56295a3f314ed01.tar.bz2 otp-c864dc812dc853e101714185b56295a3f314ed01.zip |
Merge branch 'bmk/inets/inets59_integration' into bmk/inets/inets59_integration2
Diffstat (limited to 'lib/inets/src/http_client/httpc_handler.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index bfe9b14ef6..b8c34bd99b 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2011. All Rights Reserved. +%% Copyright Ericsson AB 2002-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -851,14 +851,17 @@ connect(SocketType, ToAddress, case IpFamily of inet6fb4 -> Opts3 = [inet6 | Opts2], - case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of - {error, _Reason} = Error -> + case http_transport:connect(SocketType, + ToAddress, Opts3, Timeout) of + {error, Reason6} -> Opts4 = [inet | Opts2], case http_transport:connect(SocketType, ToAddress, Opts4, Timeout) of - {error, _} -> - %% Reply with the "original" error - Error; + {error, Reason4} -> + {error, {failed_connect, + [{to_address, ToAddress}, + {inet6, Opts3, Reason6}, + {inet, Opts4, Reason4}]}}; OK -> OK end; @@ -867,7 +870,13 @@ connect(SocketType, ToAddress, end; _ -> Opts3 = [IpFamily | Opts2], - http_transport:connect(SocketType, ToAddress, Opts3, Timeout) + case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of + {error, Reason} -> + {error, {failed_connect, [{to_address, ToAddress}, + {IpFamily, Opts3, Reason}]}}; + Else -> + Else + end end. connect_and_send_first_request(Address, Request, #state{options = Options} = State) -> |