mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-12-06 13:20:57 +03:00
client: Reset session packet state on disconnect
When reusing session structures for multiple connections, the packet state could be SIZE_READ before disconnect, causing initial packets of the next connection to be misinterpreted. Signed-off-by: Pavol Žáčik <pzacik@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@@ -853,6 +853,7 @@ error:
|
|||||||
session->opts.fd = SSH_INVALID_SOCKET;
|
session->opts.fd = SSH_INVALID_SOCKET;
|
||||||
session->session_state = SSH_SESSION_STATE_DISCONNECTED;
|
session->session_state = SSH_SESSION_STATE_DISCONNECTED;
|
||||||
session->pending_call_state = SSH_PENDING_CALL_NONE;
|
session->pending_call_state = SSH_PENDING_CALL_NONE;
|
||||||
|
session->packet_state = PACKET_STATE_INIT;
|
||||||
|
|
||||||
while ((it = ssh_list_get_iterator(session->channels)) != NULL) {
|
while ((it = ssh_list_get_iterator(session->channels)) != NULL) {
|
||||||
ssh_channel_do_free(ssh_iterator_value(ssh_channel, it));
|
ssh_channel_do_free(ssh_iterator_value(ssh_channel, it));
|
||||||
|
|||||||
Reference in New Issue
Block a user