In the various channel request mini-coroutines, replace
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 14 Jul 2013 17:08:35 +0000 (17:08 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sun, 14 Jul 2013 17:08:35 +0000 (17:08 +0000)
crWaitUntilV(pktin) with plain crReturnV, because those coroutines can
be called back either with a response packet from the channel request
_or_ with NULL by ssh_free meaning 'please just clean yourself up'.

git-svn-id: svn://svn.tartarus.org/sgt/putty@9927 cda61777-01e9-0310-a592-d414129be87e

ssh.c

diff --git a/ssh.c b/ssh.c
index ea2ad97..16ef056 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -7543,7 +7543,9 @@ static void ssh2_setup_x11(struct ssh_channel *c, struct Packet *pktin,
     ssh2_pkt_adduint32(pktout, ssh->x11disp->screennum);
     ssh2_pkt_send(ssh, pktout);
 
-    crWaitUntilV(pktin);
+    /* Wait to be called back with either a response packet, or NULL
+     * meaning clean up and free our data */
+    crReturnV;
 
     if (pktin) {
         if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
@@ -7573,7 +7575,9 @@ static void ssh2_setup_agent(struct ssh_channel *c, struct Packet *pktin,
                                ssh2_setup_agent, s);
     ssh2_pkt_send(ssh, pktout);
 
-    crWaitUntilV(pktin);
+    /* Wait to be called back with either a response packet, or NULL
+     * meaning clean up and free our data */
+    crReturnV;
 
     if (pktin) {
         if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
@@ -7620,7 +7624,9 @@ static void ssh2_setup_pty(struct ssh_channel *c, struct Packet *pktin,
     ssh2_pkt_send(ssh, pktout);
     ssh->state = SSH_STATE_INTERMED;
 
-    crWaitUntilV(pktin);
+    /* Wait to be called back with either a response packet, or NULL
+     * meaning clean up and free our data */
+    crReturnV;
 
     if (pktin) {
         if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS) {
@@ -7678,7 +7684,9 @@ static void ssh2_setup_env(struct ssh_channel *c, struct Packet *pktin,
        s->env_left = s->num_env;
 
        while (s->env_left > 0) {
-           crWaitUntilV(pktin);
+            /* Wait to be called back with either a response packet,
+             * or NULL meaning clean up and free our data */
+            crReturnV;
            if (!pktin) goto out;
            if (pktin->type == SSH2_MSG_CHANNEL_SUCCESS)
                s->env_ok++;