diff options
author | Ingela Anderton Andin <[email protected]> | 2015-11-11 10:30:23 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-11-11 14:47:27 +0100 |
commit | ef9d44bdd378d30dd1233dbb89abc97ecc155868 (patch) | |
tree | 7ea47111d18da53e272b894aee88b730c98efbc4 /lib | |
parent | 51a236b296a07ef488e29e4f1b38ee4d707e8a88 (diff) | |
download | otp-ef9d44bdd378d30dd1233dbb89abc97ecc155868.tar.gz otp-ef9d44bdd378d30dd1233dbb89abc97ecc155868.tar.bz2 otp-ef9d44bdd378d30dd1233dbb89abc97ecc155868.zip |
inets: Do not use internal or shell convenience functions in application
ssl:start/[1,2] is a shell convenience function and should not be called
by other applications.
inet_db:start is an internal function that we should not have to call.
This was done for legacy reasons and is no longer needed.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/inets/src/http_lib/http_transport.erl | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/lib/inets/src/http_lib/http_transport.erl b/lib/inets/src/http_lib/http_transport.erl index ddfd6a030e..ab6afe9c6c 100644 --- a/lib/inets/src/http_lib/http_transport.erl +++ b/lib/inets/src/http_lib/http_transport.erl @@ -49,39 +49,27 @@ %% start(SocketType) -> ok | {error, Reason} %% SocketType = ip_comm | {ssl, _} %% -%% Description: Makes sure inet_db or ssl is started. +%% Description: Makes sure ssl is started. %%------------------------------------------------------------------------- start(ip_comm) -> - do_start_ip_comm(); + ok; start({ip_comm, _}) -> - do_start_ip_comm(); -%% This is just for backward compatibillity + ok; start({ssl, _}) -> do_start_ssl(); start({essl, _}) -> do_start_ssl(). - -do_start_ip_comm() -> - case inet_db:start() of - {ok, _} -> - ok; - {error, {already_started, _}} -> - ok; - Error -> - Error - end. - do_start_ssl() -> - case ssl:start() of - ok -> - ok; - {error, {already_started,_}} -> - ok; - Error -> - Error + try lists:foreach(fun(App) -> + ok = application:ensure_started(App) + end, + [crypto, asn1, public_key, ssl]) + catch + _:Reason -> + {error, Reason} end. - + %%------------------------------------------------------------------------- %% connect(SocketType, Address, Options, Timeout) -> |