diff options
-rw-r--r-- | src/protocol/fqterm_ssh_socket.cpp | 1 | ||||
-rw-r--r-- | src/protocol/internal/fqterm_ssh_channel.cpp | 7 | ||||
-rw-r--r-- | src/protocol/internal/fqterm_ssh_channel.h | 1 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/protocol/fqterm_ssh_socket.cpp b/src/protocol/fqterm_ssh_socket.cpp index fff03dd..20612bf 100644 --- a/src/protocol/fqterm_ssh_socket.cpp +++ b/src/protocol/fqterm_ssh_socket.cpp @@ -157,6 +157,7 @@ void FQTermSSHSocket::init(int ssh_version) { FQ_VERIFY(connect(ssh_channel_, SIGNAL(channelOK()), this, SLOT(channelOK()))); FQ_VERIFY(connect(ssh_channel_, SIGNAL(channelReadyRead(const char *, int)), this, SLOT(channelReadyRead(const char *, int)))); FQ_VERIFY(connect(ssh_channel_, SIGNAL(channelError(QString)), this, SLOT(handleError(QString)))); + FQ_VERIFY(connect(ssh_channel_, SIGNAL(channelClosed()), this, SIGNAL(connectionClosed()))); key_exchanger_->initKex(packet_receiver_, packet_sender_); } diff --git a/src/protocol/internal/fqterm_ssh_channel.cpp b/src/protocol/internal/fqterm_ssh_channel.cpp index 38a755a..1e338c9 100644 --- a/src/protocol/internal/fqterm_ssh_channel.cpp +++ b/src/protocol/internal/fqterm_ssh_channel.cpp @@ -360,8 +360,11 @@ void FQTermSSH2Channel::processChannelPacket() { // byte SSH_MSG_CHANNEL_EOF // uint32 recipient channel // FIXME: this error would cause the connection closed, while only the channel need be closed in ssh2. - emit channelError(tr("Channel closed by the server.")); - break; + packet_sender_->startPacket(SSH2_MSG_CHANNEL_CLOSE); + packet_sender_->putInt(server_channel_id_); + packet_sender_->write(); + emit channelClosed(); + break; case SSH2_MSG_CHANNEL_REQUEST: // byte SSH_MSG_CHANNEL_REQUEST // uint32 recipient channel diff --git a/src/protocol/internal/fqterm_ssh_channel.h b/src/protocol/internal/fqterm_ssh_channel.h index 9922528..b0673ba 100644 --- a/src/protocol/internal/fqterm_ssh_channel.h +++ b/src/protocol/internal/fqterm_ssh_channel.h @@ -57,6 +57,7 @@ signals: void channelOK(); void channelReadyRead(const char *data, int len); void channelError(QString); + void channelClosed(); }; class FQTermSSH1Channel: public FQTermSSHChannel { |