--- ssh_cm.erl 2008-07-21 19:14:02.000000000 +0400 +++ ssh_cm1.erl 2008-08-04 18:26:26.000000000 +0400 @@ -892,6 +892,7 @@ ssh_message(SSH, Msg, State) -> "exit-status" -> <> = Data, send_user(CTab, Channel, {exit_status,Channel,Status}), + send_reply(SSH, Channel, WantReply, success), State; "exit-signal" -> @@ -903,11 +904,13 @@ ssh_message(SSH, Msg, State) -> binary_to_list(SigName), binary_to_list(Err), binary_to_list(Lang)}), + send_reply(SSH, Channel, WantReply, success), State; "xon-xoff" -> <> = Data, send_user(CTab, Channel, {xon_xoff, Channel, CDo=/= 0}), + send_reply(SSH, Channel, WantReply, success), State; "window-change" -> @@ -916,18 +919,21 @@ ssh_message(SSH, Msg, State) -> send_user(CTab, Channel, {window_change,Channel, Width, Height, PixWidth, PixHeight}), + send_reply(SSH, Channel, WantReply, success), State; "signal" -> <> = Data, send_user(CTab, Channel, {signal,Channel, binary_to_list(SigName)}), + send_reply(SSH, Channel, WantReply, success), State; "subsystem" -> <> = Data, send_user(CTab, Channel, {subsystem, Channel, WantReply, binary_to_list(SsName)}), + send_reply(SSH, Channel, WantReply, success), receive {same_user, _OldUser} -> State; @@ -952,25 +958,24 @@ ssh_message(SSH, Msg, State) -> pixel_height = PixHeight, modes = decode_pty_opts(Modes)}, send_user(CTab, Channel, {pty, Channel, WantReply, Pty}), + send_reply(SSH, Channel, WantReply, success), State; "shell" -> send_user(CTab, Channel, {shell}), + send_reply(SSH, Channel, WantReply, success), State; "exec" -> <> = Data, send_user(CTab, Channel, {exec, binary_to_list(Command)}), + send_reply(SSH, Channel, WantReply, success), State; _Other -> ?dbg(true, "ssh_msg ssh_msg_channel_request: Other=~p\n", [_Other]), - if WantReply == true -> - channel_failure(SSH, Channel); - true -> - ignore - end, + send_reply(SSH, Channel, WantReply, failure), State end; @@ -1001,6 +1006,13 @@ ssh_message(SSH, Msg, State) -> State end. +send_reply(SSH, Channel, _WantReply = true, success) -> + channel_success(SSH, Channel); +send_reply(SSH, Channel, _WantReply = true, failure) -> + channel_failure(SSH, Channel); +send_reply(_SSH, _Channel, _WantReply, _SuccessOrFailure) -> + ignore. + cm_message(SSH, Msg, State) -> CTab = State#state.ctab, case Msg of