mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 01:48:00 +00:00
When starting a SOCKS connection in dynamic forwarding, freeze the
local socket _before_ calling the SSH setup functions. This makes no difference to ssh.c itself, but it makes portfwd.c easier to reuse for other purposes (e.g. as a component of a standalone SOCKS server), because now ssh_send_port_open() can itself call pfd_confirm() without the freeze and unfreeze happening in the wrong order. [originally from svn r8500]
This commit is contained in:
parent
87aafaa89a
commit
74baacffa3
11
portfwd.c
11
portfwd.c
@ -278,6 +278,12 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
|
|||||||
*/
|
*/
|
||||||
connect:
|
connect:
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Freeze the socket until the SSH server confirms the
|
||||||
|
* connection.
|
||||||
|
*/
|
||||||
|
sk_set_frozen(pr->s, 1);
|
||||||
|
|
||||||
pr->c = new_sock_channel(pr->backhandle, pr->s);
|
pr->c = new_sock_channel(pr->backhandle, pr->s);
|
||||||
if (pr->c == NULL) {
|
if (pr->c == NULL) {
|
||||||
pfd_close(pr->s);
|
pfd_close(pr->s);
|
||||||
@ -288,11 +294,6 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len)
|
|||||||
}
|
}
|
||||||
pr->dynamic = 0;
|
pr->dynamic = 0;
|
||||||
|
|
||||||
/*
|
|
||||||
* Now freeze the socket until the SSH server confirms the
|
|
||||||
* connection.
|
|
||||||
*/
|
|
||||||
sk_set_frozen(pr->s, 1);
|
|
||||||
/*
|
/*
|
||||||
* If there's any data remaining in our current buffer,
|
* If there's any data remaining in our current buffer,
|
||||||
* save it to be sent on pfd_confirm().
|
* save it to be sent on pfd_confirm().
|
||||||
|
Loading…
Reference in New Issue
Block a user