aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPéter Dimitrov <[email protected]>2018-03-01 17:07:12 +0100
committerPéter Dimitrov <[email protected]>2018-03-28 10:19:38 +0200
commitbe82a5b6ed52be90ec5fd55b70002f9a2a89265a (patch)
tree436bfeabc9298118638993aad41e81bd8da5da1d
parent94cbd3390c7ee4e75062ba1b248cfd162235aec6 (diff)
downloadotp-be82a5b6ed52be90ec5fd55b70002f9a2a89265a.tar.gz
otp-be82a5b6ed52be90ec5fd55b70002f9a2a89265a.tar.bz2
otp-be82a5b6ed52be90ec5fd55b70002f9a2a89265a.zip
inets: Support ftp stand_alone mode
Change-Id: I38bbca9d3fb2d90869cfe468e444204514301c36
-rw-r--r--lib/ftp/src/ftp.erl19
-rw-r--r--lib/inets/src/inets_app/inets_ftp_wrapper.erl5
2 files changed, 22 insertions, 2 deletions
diff --git a/lib/ftp/src/ftp.erl b/lib/ftp/src/ftp.erl
index 6bf83184e3..083ca9fc87 100644
--- a/lib/ftp/src/ftp.erl
+++ b/lib/ftp/src/ftp.erl
@@ -31,6 +31,10 @@
service_info/1
]).
+%% Added for backward compatibility
+%% Called by inets:start()
+-export([start_standalone/1]).
+
-export([start_link/1, start_link/2]).
%% API - Client interface
@@ -128,6 +132,21 @@
start() ->
application:start(ftp).
+start_standalone(Options) ->
+ try
+ {ok, StartOptions} = start_options(Options),
+ {ok, OpenOptions} = open_options(Options),
+ case start_link(StartOptions, []) of
+ {ok, Pid} ->
+ call(Pid, {open, ip_comm, OpenOptions}, plain);
+ Error1 ->
+ Error1
+ end
+ catch
+ throw:Error2 ->
+ Error2
+ end.
+
start_service(Options) ->
try
{ok, StartOptions} = start_options(Options),
diff --git a/lib/inets/src/inets_app/inets_ftp_wrapper.erl b/lib/inets/src/inets_app/inets_ftp_wrapper.erl
index b3fc7a8436..e350a490f7 100644
--- a/lib/inets/src/inets_app/inets_ftp_wrapper.erl
+++ b/lib/inets/src/inets_app/inets_ftp_wrapper.erl
@@ -27,8 +27,9 @@
service_info/1]).
-start_standalone(_) ->
- ok.
+start_standalone(Options) ->
+ ftp:start_standalone(Options).
+
start_service(Options) ->
application:ensure_started(ftp),