From cc621c57ce7c41c2b46a103136575bca445aedd0 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Wed, 16 Jun 2010 12:00:00 +0200 Subject: ssh: Patch 1126 OTP-8714 SSH in some cases terminated channels with reason normal when it should have been shutdown. --- lib/ssh/doc/src/notes.xml | 16 ++++++++++++++++ lib/ssh/src/ssh.appup.src | 2 ++ lib/ssh/src/ssh_channel.erl | 24 +++++++++++++++++------- lib/ssh/vsn.mk | 6 ++++-- 4 files changed, 39 insertions(+), 9 deletions(-) (limited to 'lib/ssh') diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index 1e4870c8fb..dad3239d45 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -29,6 +29,22 @@ notes.xml +
Ssh 1.1.10 + +
Fixed Bugs and Malfunctions + + +

+ SSH in some cases terminated channels with reason + normal when it should have been shutdown.

+

+ Own Id: OTP-8714 Aux Id:

+
+
+
+ +
+
Ssh 1.1.9
Fixed Bugs and Malfunctions diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index dac8f55eaa..1042355112 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -19,6 +19,7 @@ {"%VSN%", [ + {"1.1.9", [{load_module, ssh_channel, soft_purge, soft_purge, []}]}, {"1.1.8", [{restart_application, ssh}]}, {"1.1.7", [{restart_application, ssh}]}, {"1.1.6", [{restart_application, ssh}]}, @@ -28,6 +29,7 @@ {"1.1.2", [{restart_application, ssh}]} ], [ + {"1.1.9", [{load_module, ssh_channel, soft_purge, soft_purge, []}]}, {"1.1.8", [{restart_application, ssh}]}, {"1.1.7", [{restart_application, ssh}]}, {"1.1.6", [{restart_application, ssh}]}, diff --git a/lib/ssh/src/ssh_channel.erl b/lib/ssh/src/ssh_channel.erl index 3d67065ee1..dcb2d69290 100644 --- a/lib/ssh/src/ssh_channel.erl +++ b/lib/ssh/src/ssh_channel.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% -%% Copyright Ericsson AB 2008-2009. All Rights Reserved. -%% +%% +%% Copyright Ericsson AB 2008-2010. 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 %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% @@ -238,9 +238,19 @@ handle_info(Msg, #state{cm = ConnectionManager, channel_cb = Module, {noreply, State#state{channel_state = ChannelState}}; {ok, ChannelState, Timeout} -> {noreply, State#state{channel_state = ChannelState}, Timeout}; + {stop, Reason, ChannelState} when is_atom(Reason)-> + {stop, Reason, State#state{close_sent = true, + channel_state = ChannelState}}; {stop, ChannelId, ChannelState} -> - ssh_connection:close(ConnectionManager, ChannelId), - {stop, normal, State#state{close_sent = true, + Reason = + case Msg of + {'EXIT', _Pid, shutdown} -> + shutdown; + _ -> + normal + end, + (catch ssh_connection:close(ConnectionManager, ChannelId)), + {stop, Reason, State#state{close_sent = true, channel_state = ChannelState}} end. diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index 78802c6a2d..55340a2aa4 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,9 +1,11 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 1.1.9 +SSH_VSN = 1.1.10 APP_VSN = "ssh-$(SSH_VSN)" -TICKETS = OTP-8524 \ +TICKETS = OTP-8714 + +TICKETS_1.1.9 = OTP-8524 \ OTP-8534 \ OTP-8535 \ OTP-8550 \ -- cgit v1.2.3 From ab325a413370057ecf142448dffea56d28616f47 Mon Sep 17 00:00:00 2001 From: Niclas Eklund Date: Tue, 13 Jul 2010 12:00:00 +0200 Subject: ssh: Patch 1127 OTP-8735 SSH in some cases generated a crash report when a channel was closed in a normal way. --- lib/ssh/doc/src/notes.xml | 20 ++++++++++++++++++-- lib/ssh/src/ssh.appup.src | 16 ++++++++++------ lib/ssh/src/ssh_connection_manager.erl | 16 +++++++++++----- lib/ssh/vsn.mk | 6 ++++-- 4 files changed, 43 insertions(+), 15 deletions(-) (limited to 'lib/ssh') diff --git a/lib/ssh/doc/src/notes.xml b/lib/ssh/doc/src/notes.xml index dad3239d45..ce18cabfb5 100644 --- a/lib/ssh/doc/src/notes.xml +++ b/lib/ssh/doc/src/notes.xml @@ -13,12 +13,12 @@ compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved online at http://www.erlang.org/. - + Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. - + SSH Release Notes @@ -29,6 +29,22 @@ notes.xml +
Ssh 1.1.11 + +
Fixed Bugs and Malfunctions + + +

+ SSH in some cases generated a crash report when a channel + was closed in a normal way.

+

+ Own Id: OTP-8735 Aux Id: seq11615

+
+
+
+ +
+
Ssh 1.1.10
Fixed Bugs and Malfunctions diff --git a/lib/ssh/src/ssh.appup.src b/lib/ssh/src/ssh.appup.src index 1042355112..82114c9afd 100644 --- a/lib/ssh/src/ssh.appup.src +++ b/lib/ssh/src/ssh.appup.src @@ -1,25 +1,27 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2004-2010. 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 %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% {"%VSN%", [ - {"1.1.9", [{load_module, ssh_channel, soft_purge, soft_purge, []}]}, + {"1.1.10", [{load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"1.1.9", [{load_module, ssh_channel, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"1.1.8", [{restart_application, ssh}]}, {"1.1.7", [{restart_application, ssh}]}, {"1.1.6", [{restart_application, ssh}]}, @@ -29,7 +31,9 @@ {"1.1.2", [{restart_application, ssh}]} ], [ - {"1.1.9", [{load_module, ssh_channel, soft_purge, soft_purge, []}]}, + {"1.1.10", [{load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, + {"1.1.9", [{load_module, ssh_channel, soft_purge, soft_purge, []}, + {load_module, ssh_connection_manager, soft_purge, soft_purge, []}]}, {"1.1.8", [{restart_application, ssh}]}, {"1.1.7", [{restart_application, ssh}]}, {"1.1.6", [{restart_application, ssh}]}, diff --git a/lib/ssh/src/ssh_connection_manager.erl b/lib/ssh/src/ssh_connection_manager.erl index cffeade485..9e55312e5f 100644 --- a/lib/ssh/src/ssh_connection_manager.erl +++ b/lib/ssh/src/ssh_connection_manager.erl @@ -1,19 +1,19 @@ %% %% %CopyrightBegin% -%% +%% %% Copyright Ericsson AB 2008-2010. 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 %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved online at http://www.erlang.org/. -%% +%% %% Software distributed under the License is distributed on an "AS IS" %% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See %% the License for the specific language governing rights and limitations %% under the License. -%% +%% %% %CopyrightEnd% %% %% @@ -146,6 +146,8 @@ adjust_window(ConnectionManager, Channel, Bytes) -> close(ConnectionManager, ChannelId) -> try call(ConnectionManager, {close, ChannelId}) of ok -> + ok; + {error,normal} -> ok catch exit:{noproc, _} -> @@ -155,6 +157,8 @@ close(ConnectionManager, ChannelId) -> stop(ConnectionManager) -> try call(ConnectionManager, stop) of ok -> + ok; + {error,normal} -> ok catch exit:{noproc, _} -> @@ -593,7 +597,9 @@ call(Pid, Msg, Timeout) -> Result catch exit:{timeout, _} -> - {error, timeout} + {error, timeout}; + exit:{normal, _} -> + {error, normal} end. cast(Pid, Msg) -> diff --git a/lib/ssh/vsn.mk b/lib/ssh/vsn.mk index 55340a2aa4..8e31851a8e 100644 --- a/lib/ssh/vsn.mk +++ b/lib/ssh/vsn.mk @@ -1,9 +1,11 @@ #-*-makefile-*- ; force emacs to enter makefile-mode -SSH_VSN = 1.1.10 +SSH_VSN = 1.1.11 APP_VSN = "ssh-$(SSH_VSN)" -TICKETS = OTP-8714 +TICKETS = OTP-8735 + +TICKETS_1.1.10 = OTP-8714 TICKETS_1.1.9 = OTP-8524 \ OTP-8534 \ -- cgit v1.2.3