diff options
author | Micael Karlberg <[email protected]> | 2011-12-08 14:46:18 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-02-03 18:20:47 +0100 |
commit | 2919a7505963054e442cf2e8fc9ff46739a0d0d9 (patch) | |
tree | d66fda5145c62428c707ce02751e3a16923ae314 | |
parent | ab2ba6f1b0713fbe5c78f67aeefb73ffc006e995 (diff) | |
download | otp-2919a7505963054e442cf2e8fc9ff46739a0d0d9.tar.gz otp-2919a7505963054e442cf2e8fc9ff46739a0d0d9.tar.bz2 otp-2919a7505963054e442cf2e8fc9ff46739a0d0d9.zip |
[inets] Added more error info when connect fails
-rw-r--r-- | lib/inets/src/http_client/httpc_handler.erl | 16 | ||||
-rw-r--r-- | lib/inets/src/inets_app/inets.appup.src | 64 |
2 files changed, 32 insertions, 48 deletions
diff --git a/lib/inets/src/http_client/httpc_handler.erl b/lib/inets/src/http_client/httpc_handler.erl index bfe9b14ef6..714fd6f16d 100644 --- a/lib/inets/src/http_client/httpc_handler.erl +++ b/lib/inets/src/http_client/httpc_handler.erl @@ -852,13 +852,14 @@ connect(SocketType, ToAddress, inet6fb4 -> Opts3 = [inet6 | Opts2], case http_transport:connect(SocketType, ToAddress, Opts3, Timeout) of - {error, _Reason} = Error -> + {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, + [{inet6, Opts3, Reason6}, + {inet, Opts4, Reason4}]}}; OK -> OK end; @@ -867,7 +868,12 @@ 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, [{IpFamily, Opts3, Reason}]}}; + Else -> + Else + end end. connect_and_send_first_request(Address, Request, #state{options = Options} = State) -> diff --git a/lib/inets/src/inets_app/inets.appup.src b/lib/inets/src/inets_app/inets.appup.src index e80cb2a23b..f47ca98d1a 100644 --- a/lib/inets/src/inets_app/inets.appup.src +++ b/lib/inets/src/inets_app/inets.appup.src @@ -18,65 +18,43 @@ {"%VSN%", [ + {"5.8.1", + [ + {load_module, inets, soft_purge, soft_purge, [inets_trace]}, + {update, httpc_handler, soft, soft_purge, soft_purge, []}, + {add_module, inets_trace} + ] + }, {"5.8", [ + {load_module, inets, soft_purge, soft_purge, [inets_trace]}, {load_module, ftp, soft_purge, soft_purge, []}, {update, httpc_handler, {advanced, upgrade_from_pre_5_8_1}, soft_purge, soft_purge, []}, {update, httpc_manager, {advanced, upgrade_from_pre_5_8_1}, - soft_purge, soft_purge, [httpc_handler]} - ] - }, - {"5.7.2", - [ - {restart_application, inets} - ] - }, - {"5.7.1", - [ - {restart_application, inets} + soft_purge, soft_purge, [httpc_handler]}, + {add_module, inets_trace} ] - }, - {"5.7", + } + ], + [ + {"5.8.1", [ - {restart_application, inets} + {load_module, inets, soft_purge, soft_purge, []}, + {update, httpc_handler, soft, soft_purge, soft_purge, []}, + {remove, {inets_trace, soft_purge, brutal_purge}} ] }, - {"5.6", - [ - {restart_application, inets} - ] - } - ], - [ {"5.8", [ + {load_module, inets, soft_purge, soft_purge, [inets_trace]}, {load_module, ftp, soft_purge, soft_purge, []}, {update, httpc_handler, {advanced, upgrade_from_pre_5_8_1}, soft_purge, soft_purge, []}, {update, httpc_manager, {advanced, upgrade_from_pre_5_8_1}, - soft_purge, soft_purge, [httpc_handler]} - ] - }, - {"5.7.2", - [ - {restart_application, inets} - ] - }, - {"5.7.1", - [ - {restart_application, inets} - ] - }, - {"5.7", - [ - {restart_application, inets} - ] - }, - {"5.6", - [ - {restart_application, inets} + soft_purge, soft_purge, [httpc_handler]}, + {remove, {inets_trace, soft_purge, brutal_purge}} ] - } + } ] }. |