X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/61ef0c16fb901a7c8992e8f46318c609146c0fbc..09d133f3aa04b42a52ae13fd4ba25e80bee5ebf0:/portfwd.c diff --git a/portfwd.c b/portfwd.c index e6cf2005..662d995d 100644 --- a/portfwd.c +++ b/portfwd.c @@ -278,6 +278,12 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len) */ 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); if (pr->c == NULL) { pfd_close(pr->s); @@ -289,11 +295,6 @@ static int pfd_receive(Plug plug, int urgent, char *data, int len) 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, * save it to be sent on pfd_confirm(). */