]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - portfwd.c
When starting a SOCKS connection in dynamic forwarding, freeze the
[PuTTY.git] / portfwd.c
index e6cf20059476a5e3c78467abdef52e6abc936587..662d995d89444f1f99e352360d18ac4272651357 100644 (file)
--- 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);
@@ -288,11 +294,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().