mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-08 19:31:58 +00:00
Added ssh stream cleanup
This commit is contained in:
parent
58ba0a4eba
commit
22595b8480
@ -97,7 +97,6 @@ static int ssh_stream_read(
|
||||
return -1;
|
||||
|
||||
int rc = libssh2_channel_read(s->channel, buffer, buf_size);
|
||||
|
||||
if (rc < 0)
|
||||
return -1;
|
||||
|
||||
@ -134,6 +133,16 @@ static void ssh_stream_free(git_smart_subtransport_stream *stream)
|
||||
|
||||
t->current_stream = NULL;
|
||||
|
||||
if (s->channel) {
|
||||
libssh2_channel_close(s->channel);
|
||||
libssh2_channel_free(s->channel);
|
||||
s->channel = NULL;
|
||||
}
|
||||
|
||||
if (s->session) {
|
||||
libssh2_session_free(s->session), s->session = NULL;
|
||||
}
|
||||
|
||||
if (s->socket.socket) {
|
||||
ret = gitno_close(&s->socket);
|
||||
assert(!ret);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user