mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
ssh_do_close() should close any listening sockets associated with
port-forwardings. [originally from svn r5325]
This commit is contained in:
parent
077ce4012f
commit
92ccb964a2
14
ssh.c
14
ssh.c
@ -2409,6 +2409,20 @@ static int ssh_do_close(Ssh ssh, int notify_exit)
|
||||
sfree(c);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Go through port-forwardings, and close any associated
|
||||
* listening sockets.
|
||||
*/
|
||||
if (ssh->portfwds) {
|
||||
struct ssh_portfwd *pf;
|
||||
while (NULL != (pf = index234(ssh->portfwds, 0))) {
|
||||
/* Dispose of any listening socket. */
|
||||
if (pf->local)
|
||||
pfd_terminate(pf->local);
|
||||
del234(ssh->portfwds, pf); /* moving next one to index 0 */
|
||||
free_portfwd(pf);
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user