diff options
author | Ingela Anderton Andin <[email protected]> | 2015-04-15 19:24:08 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2015-04-15 19:24:08 +0200 |
commit | eff81b18db74e1d22db82d7d299e77cf5cf99a55 (patch) | |
tree | 54d9f0609fdf681b1e6b2a1c66a5f76a25bd873c /lib | |
parent | 0fc485a1b487f0b22daf2178e28b2f3edfdc7919 (diff) | |
parent | fee64d33a788bf6e32a53e1d665c498c86004980 (diff) | |
download | otp-eff81b18db74e1d22db82d7d299e77cf5cf99a55.tar.gz otp-eff81b18db74e1d22db82d7d299e77cf5cf99a55.tar.bz2 otp-eff81b18db74e1d22db82d7d299e77cf5cf99a55.zip |
Merge branch 'ia/ssh/channel-gracefull-shutdown/OTP-12648'
* ia/ssh/channel-gracefull-shutdown/OTP-12648:
ssh: Shutdown sftp channel gracefully
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ssh/src/ssh_sftp.erl | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_sftp.erl b/lib/ssh/src/ssh_sftp.erl index 613f8f25b2..c264eabc78 100644 --- a/lib/ssh/src/ssh_sftp.erl +++ b/lib/ssh/src/ssh_sftp.erl @@ -111,7 +111,7 @@ start_channel(Cm, Opts) when is_pid(Cm) -> TimeOut end; {error, Reason} -> - {error, Reason}; + {error, format_channel_start_error(Reason)}; ignore -> {error, ignore} end; @@ -136,7 +136,7 @@ start_channel(Host, Port, Opts) -> TimeOut end; {error, Reason} -> - {error, Reason}; + {error, format_channel_start_error(Reason)}; ignore -> {error, ignore} end; @@ -491,9 +491,9 @@ init([Cm, ChannelId, Options]) -> inf = new_inf(), opts = Options}}; failure -> - {stop, "server failed to start sftp subsystem"}; + {stop, {shutdown, "server failed to start sftp subsystem"}}; Error -> - {stop, Error} + {stop, {shutdown, Error}} end. %%-------------------------------------------------------------------- @@ -1412,3 +1412,8 @@ open_buf1(Pid, BufInfo0, FileOpTimeout, CryptoState, ChunkSize) -> BufHandle = make_ref(), call(Pid, {put_bufinf,BufHandle,BufInfo}, FileOpTimeout), {ok,BufHandle}. + +format_channel_start_error({shutdown, Reason}) -> + Reason; +format_channel_start_error(Reason) -> + Reason. |