diff --git a/include/libssh/session.h b/include/libssh/session.h index 8961d3ad..329b5ebd 100644 --- a/include/libssh/session.h +++ b/include/libssh/session.h @@ -140,7 +140,7 @@ struct ssh_session_struct { ssh_string banner; /* that's the issue banner from the server */ - char *discon_msg; /* disconnect message from + char *peer_discon_msg; /* disconnect message from the remote host */ char *disconnect_message; /* disconnect message to be set */ ssh_buffer in_buffer; diff --git a/src/session.c b/src/session.c index e70edfe0..05919b24 100644 --- a/src/session.c +++ b/src/session.c @@ -826,11 +826,11 @@ const char *ssh_get_disconnect_message(ssh_session session) { if (session->session_state != SSH_SESSION_STATE_DISCONNECTED) { ssh_set_error(session, SSH_REQUEST_DENIED, "Connection not closed yet"); - } else if(!session->discon_msg) { + } else if(!session->peer_discon_msg) { ssh_set_error(session, SSH_FATAL, "Connection correctly closed but no disconnect message"); } else { - return session->discon_msg; + return session->peer_discon_msg; } return NULL;