diff options
author | Ingela Anderton Andin <[email protected]> | 2015-06-26 08:47:38 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-06-26 11:35:31 +0200 |
commit | fcbf2e682cedebdf768dc90273889b1f8d4b2ce4 (patch) | |
tree | 28e429fafddc8b5cdb9e2e4141f2730fc3c1b3f9 /lib/ssh/src/ssh_sftp.erl | |
parent | 0f3f8f5871a1ea503cc80ae17adc8dec96c79445 (diff) | |
download | otp-fcbf2e682cedebdf768dc90273889b1f8d4b2ce4.tar.gz otp-fcbf2e682cedebdf768dc90273889b1f8d4b2ce4.tar.bz2 otp-fcbf2e682cedebdf768dc90273889b1f8d4b2ce4.zip |
ssh: Use old crypto with newer ssh
Many issues with previous process design, causing for instance process leaks,
are compleatly gone in the redesigned ssh-3.0 and later.
This is a backport of newer ssh design to R15B
Diffstat (limited to 'lib/ssh/src/ssh_sftp.erl')
-rw-r--r-- | lib/ssh/src/ssh_sftp.erl | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl index f000558100..10167a9223 100644 --- a/lib/ssh/src/ssh_sftp.erl +++ b/lib/ssh/src/ssh_sftp.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2005-2011. All Rights Reserved. +%% Copyright Ericsson AB 2005-2013. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -47,7 +47,7 @@ recv_window/2, list_dir/3, read_file/3, write_file/4]). %% ssh_channel callbacks --export([init/1, handle_call/3, handle_msg/2, handle_ssh_msg/2, terminate/2]). +-export([init/1, handle_call/3, handle_cast/2, code_change/3, handle_msg/2, handle_ssh_msg/2, terminate/2]). %% TODO: Should be placed elsewhere ssh_sftpd should not call functions in ssh_sftp! -export([info_to_attr/1, attr_to_info/1]). @@ -403,7 +403,7 @@ init([Cm, ChannelId, Timeout]) -> rep_buf = <<>>, inf = new_inf()}}; failure -> - {stop, {error, "server failed to start sftp subsystem"}}; + {stop, "server failed to start sftp subsystem"}; Error -> {stop, Error} end. @@ -436,6 +436,12 @@ handle_call({{timeout, Timeout}, Msg}, From, #state{req_id = Id} = State) -> timer:send_after(Timeout, {timeout, Id, From}), do_handle_call(Msg, From, State). +handle_cast(_,State) -> + {noreply, State}. + +code_change(_OldVsn, State, _Extra) -> + {ok, State}. + do_handle_call({open, Async,FileName,Mode}, From, #state{xf = XF} = State) -> {Access,Flags,Attrs} = open_mode(XF#ssh_xfer.vsn, Mode), ReqID = State#state.req_id, |