diff options
author | Péter Dimitrov <[email protected]> | 2018-03-01 17:07:12 +0100 |
---|---|---|
committer | Péter Dimitrov <[email protected]> | 2018-03-28 10:19:38 +0200 |
commit | be82a5b6ed52be90ec5fd55b70002f9a2a89265a (patch) | |
tree | 436bfeabc9298118638993aad41e81bd8da5da1d /lib/ftp/src | |
parent | 94cbd3390c7ee4e75062ba1b248cfd162235aec6 (diff) | |
download | otp-be82a5b6ed52be90ec5fd55b70002f9a2a89265a.tar.gz otp-be82a5b6ed52be90ec5fd55b70002f9a2a89265a.tar.bz2 otp-be82a5b6ed52be90ec5fd55b70002f9a2a89265a.zip |
inets: Support ftp stand_alone mode
Change-Id: I38bbca9d3fb2d90869cfe468e444204514301c36
Diffstat (limited to 'lib/ftp/src')
-rw-r--r-- | lib/ftp/src/ftp.erl | 19 |
1 files changed, 19 insertions, 0 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), |