aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_connection.erl
diff options
context:
space:
mode:
authorIngela Anderton Andin <[email protected]>2012-05-11 10:13:23 +0200
committerIngela Anderton Andin <[email protected]>2012-05-11 10:13:23 +0200
commit241eab82ad76d68dbef3efdb4066d14b82fd0234 (patch)
treee3c7a8f2a6fbbf4fe8bcc3cb9c57fade2ff22f83 /lib/ssh/src/ssh_connection.erl
parent6653b819f8bad11e06b52c1c371264e3389737bf (diff)
parent02fa402909ede20b75f1aa6e4c133d866ddc506b (diff)
downloadotp-241eab82ad76d68dbef3efdb4066d14b82fd0234.tar.gz
otp-241eab82ad76d68dbef3efdb4066d14b82fd0234.tar.bz2
otp-241eab82ad76d68dbef3efdb4066d14b82fd0234.zip
Merge branch 'ia/ssh/remote-connetion-id/OTP-10062' into maint
* ia/ssh/remote-connetion-id/OTP-10062: The channel id in a channel failure message, sent to the peer, is now in all cases the remote channel id
Diffstat (limited to 'lib/ssh/src/ssh_connection.erl')
-rw-r--r--lib/ssh/src/ssh_connection.erl13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/ssh/src/ssh_connection.erl b/lib/ssh/src/ssh_connection.erl
index 46f0c7e688..c46f799b6d 100644
--- a/lib/ssh/src/ssh_connection.erl
+++ b/lib/ssh/src/ssh_connection.erl
@@ -720,12 +720,17 @@ handle_msg(#ssh_msg_channel_request{request_type = "env"},
handle_msg(#ssh_msg_channel_request{recipient_channel = ChannelId,
request_type = _Other,
- want_reply = WantReply}, Connection,
+ want_reply = WantReply}, #connection{channel_cache = Cache} = Connection,
ConnectionPid, _) ->
if WantReply == true ->
- FailMsg = channel_failure_msg(ChannelId),
- {{replies, [{connection_reply, ConnectionPid, FailMsg}]},
- Connection};
+ case ssh_channel:cache_lookup(Cache, ChannelId) of
+ #channel{remote_id = RemoteId} ->
+ FailMsg = channel_failure_msg(RemoteId),
+ {{replies, [{connection_reply, ConnectionPid, FailMsg}]},
+ Connection};
+ undefined -> %% Chanel has been closed
+ {noreply, Connection}
+ end;
true ->
{noreply, Connection}
end;