aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/ftp/ftp.erl
diff options
context:
space:
mode:
authorErland Schönbeck <[email protected]>2015-03-17 11:56:14 +0100
committerRickard Green <[email protected]>2015-03-20 15:28:54 +0100
commit7cdde7537deccd53d95d03860379f3d20ad2e265 (patch)
tree8d2c7cc5b86e6a57e840efcd781abe8067c9f614 /lib/inets/src/ftp/ftp.erl
parent87ae700c7383b74b8ddade6bfe30481dcdc5b6c7 (diff)
downloadotp-7cdde7537deccd53d95d03860379f3d20ad2e265.tar.gz
otp-7cdde7537deccd53d95d03860379f3d20ad2e265.tar.bz2
otp-7cdde7537deccd53d95d03860379f3d20ad2e265.zip
inets: Cleanup of multiple copies of functions
Add inets_lib with common functions used by multiple modules
Diffstat (limited to 'lib/inets/src/ftp/ftp.erl')
-rw-r--r--lib/inets/src/ftp/ftp.erl13
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/inets/src/ftp/ftp.erl b/lib/inets/src/ftp/ftp.erl
index fa10043e49..361a775024 100644
--- a/lib/inets/src/ftp/ftp.erl
+++ b/lib/inets/src/ftp/ftp.erl
@@ -2189,7 +2189,7 @@ setup_ctrl_connection(Host, Port, Timeout, State) ->
{ok, IpFam, CSock} ->
NewState = State#state{csock = {tcp, CSock}, ipfamily = IpFam},
activate_ctrl_connection(NewState),
- case Timeout - millisec_passed(MsTime) of
+ case Timeout - inets_lib:millisec_passed(MsTime) of
Timeout2 when (Timeout2 >= 0) ->
{ok, NewState#state{caller = open}, Timeout2};
_ ->
@@ -2509,17 +2509,6 @@ progress_report(Report, #state{progress = ProgressPid}) ->
ftp_progress:report(ProgressPid, Report).
-%% Help function, elapsed milliseconds since T0
-millisec_passed({_,_,_} = T0 ) ->
- %% OTP 17 and earlier
- timer:now_diff(erlang:now(), T0) div 1000;
-
-millisec_passed(T0) ->
- %% OTP 18
- erlang:convert_time_resolution(erlang:monotonic_time() - T0,
- erlang:time_resolution(),
- 1000000) div 1000.
-
peername({tcp, Socket}) -> inet:peername(Socket);
peername({ssl, Socket}) -> ssl:peername(Socket).