1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-29 01:03:57 +03:00

channels: replaced bugged lists with ssh_list

cherry-picked from 0aef5f
Conflicts:

	src/session.c
This commit is contained in:
Aris Adamantiadis
2011-09-02 13:46:10 +03:00
parent 3eece8ac0b
commit 6d8bb956c5
7 changed files with 42 additions and 41 deletions

View File

@@ -732,6 +732,7 @@ int ssh_get_openssh_version(ssh_session session) {
*/
void ssh_disconnect(ssh_session session) {
ssh_string str = NULL;
struct ssh_iterator *it;
int i;
if (session == NULL) {
@@ -770,8 +771,10 @@ error:
}
session->fd = SSH_INVALID_SOCKET;
session->session_state=SSH_SESSION_STATE_DISCONNECTED;
while (session->channels) {
ssh_channel_free(session->channels);
while ((it=ssh_list_get_iterator(session->channels)) != NULL) {
ssh_channel_free(ssh_iterator_value(ssh_channel,it));
ssh_list_remove(session->channels, it);
}
if(session->current_crypto){
crypto_free(session->current_crypto);