diff options
author | Ingela Anderton Andin <[email protected]> | 2011-12-09 09:13:06 +0100 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2011-12-09 09:13:06 +0100 |
commit | 2d48e2ed0565c5e3f6979e3abc4299e4a9994d20 (patch) | |
tree | bf9b3d415b46ea777c53e2cc942cd0c374d384af | |
parent | 1fc974da091f24ef2e10ff3d293ab88cd48a3755 (diff) | |
parent | b61df764e078ba916f16abf633f44b89cffb69cc (diff) | |
download | otp-2d48e2ed0565c5e3f6979e3abc4299e4a9994d20.tar.gz otp-2d48e2ed0565c5e3f6979e3abc4299e4a9994d20.tar.bz2 otp-2d48e2ed0565c5e3f6979e3abc4299e4a9994d20.zip |
Merge branch 'ia/ssh/behaviour/OTP-9796'
* ia/ssh/behaviour/OTP-9796:
Use new directive "-callback" and prepare version and appup for release
-rw-r--r-- | lib/ssh/src/ssh.appup.src | 6 | ||||
-rw-r--r-- | lib/ssh/src/ssh_channel.erl | 28 | ||||
-rw-r--r-- | lib/ssh/src/ssh_sftpd_file_api.erl | 62 | ||||
-rw-r--r-- | lib/ssh/vsn.mk | 2 |
4 files changed, 59 insertions, 39 deletions
diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 150b7d86dd..21a0582c06 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -18,7 +18,9 @@ %% {"%VSN%", - [ + [ + {"2.0.8", [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []}, + {load_module, ssh_channel, soft_purge, soft_purge, []}]}, {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]}, {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []}, {load_module, ssh_sftp, soft_purge, soft_purge, []}]}, @@ -27,6 +29,8 @@ {load_module, ssh_connection_handler, soft_purge, soft_purge, [ssh_userreg]}]} ], [ + {"2.0.8", [{load_module, ssh_sftpd_file_api, soft_purge, soft_purge, []}, + {load_module, ssh_channel, soft_purge, soft_purge, []}]}, {"2.0.7", [{load_module, ssh_sftp, soft_purge, soft_purge, []}]}, {"2.0.6", [{load_module, ssh_userreg, soft_purge, soft_purge, []}, {load_module, ssh_sftp, soft_purge, soft_purge, []}]}, diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl index dcb2d69290..7b600ed8b2 100644 --- a/lib/ssh/src/ssh_channel.erl +++ b/lib/ssh/src/ssh_channel.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2011. 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 @@ -23,10 +23,23 @@ -include("ssh_connect.hrl"). +%%% Optional callbacks handle_call/3, handle_cast/2, handle_msg/2, +%%% code_change/3 +%% Should be further specified later +-callback init(Options::list()) -> + {ok, State::term()} | {ok, State::term(), Timeout::timeout()} | + {stop, Reason ::term()}. + +-callback terminate(term(), term()) -> term(). + +-callback handle_ssh_msg({ssh_cm, ConnectionRef::term(), SshMsg::term()}, + State::term()) -> {ok, State::term()} | + {stop, ChannelId::integer(), + State::term()}. -behaviour(gen_server). %%% API --export([behaviour_info/1, start/4, start/5, start_link/4, start_link/5, call/2, call/3, +-export([start/4, start/5, start_link/4, start_link/5, call/2, call/3, cast/2, reply/2, enter_loop/1]). %% gen_server callbacks @@ -50,17 +63,6 @@ %% API %%==================================================================== -%%% Optionel callbacks handle_call/3, handle_cast/2, handle_msg/2, -%%% code_change/3 -behaviour_info(callbacks) -> - [ - {init, 1}, - {terminate, 2}, - {handle_ssh_msg, 2}, - {handle_msg, 2} - ]. - - call(ChannelPid, Msg) -> call(ChannelPid, Msg, infinity). diff --git a/lib/ssh/src/ssh_sftpd_file_api.erl b/lib/ssh/src/ssh_sftpd_file_api.erl index 176aa98194..38371f809d 100644 --- a/lib/ssh/src/ssh_sftpd_file_api.erl +++ b/lib/ssh/src/ssh_sftpd_file_api.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2007-2010. All Rights Reserved. +%% Copyright Ericsson AB 2007-2011. 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 @@ -21,27 +21,41 @@ -module(ssh_sftpd_file_api). --export([behaviour_info/1]). +%% To be further specified later +-callback close(IoDevice::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback delete(Path::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback del_dir(Path::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback get_cwd(State::term()) -> + {ok, Dir::term()} | {error, Reason::term()}. +-callback is_dir(AbsPath::term(), State::term()) -> + boolean(). +-callback list_dir(AbsPath::term(), State::term()) -> + {ok, Filenames::term()} | {error, Reason::term()}. +-callback make_dir(Dir::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback make_symlink(Path2::term(), Path::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback open(Path::term(), Flags::term(), State::term()) -> + {ok, IoDevice::term()} | {error, Reason::term()}. +-callback position(IoDevice::term(), Offs::term(), State::term()) -> + {ok, NewPosition::term()} | {error, Reason::term()}. +-callback read(IoDevice::term(), Len::term(), State::term()) -> + {ok, Data::term()} | eof | {error, Reason::term()}. +-callback read_link(Path::term(), State::term()) -> + {ok, FileName::term()} | {error, Reason::term()}. +-callback read_link_info(Path::term(), State::term()) -> + {ok, FileInfo::term()} | {error, Reason::term()}. +-callback read_file_info(Path::term(), State::term()) -> + {ok, FileInfo::term()} | {error, Reason::term()}. +-callback rename(Path::term(), Path2::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback write(IoDevice::term(), Data::term(), State::term()) -> + ok | {error, Reason::term()}. +-callback write_file_info(Path::term(),Info::term(), State::term()) -> + ok | {error, Reason::term()}. + + -behaviour_info(callbacks) -> - [ - {close, 2}, - {delete, 2}, - {del_dir, 2}, - {get_cwd, 1}, - {is_dir, 2}, - {list_dir, 2}, - {make_dir, 2}, - {make_symlink, 3}, - {open, 3}, - {position, 3}, - {read, 3}, - {read_file_info, 2}, - {read_link, 2}, - {read_link_info, 2}, - {rename, 3}, - {write, 3}, - {write_file_info, 3} - ]; -behaviour_info(_) -> - undefined. diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index fe2b915d17..42f860d6ae 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,5 +1,5 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 2.0.8 +SSH_VSN = 2.0.9 APP_VSN = "ssh-$(SSH_VSN)" |