summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsys/src/cmd/sshnet.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/src/cmd/sshnet.c b/sys/src/cmd/sshnet.c
index 993f16021..70d4aeb2d 100755
--- a/sys/src/cmd/sshnet.c
+++ b/sys/src/cmd/sshnet.c
@@ -1086,11 +1086,13 @@ handlemsg(Msg *m)
c->sendpkt = pkt;
c->sendwin = win;
c->servernum = n;
- c->state = Established;
- if(c->wq != nil){
- respond(c->wq, nil);
- c->wq = nil;
+ if(c->wq == nil){
+ teardownclient(c);
+ break;
}
+ respond(c->wq, nil);
+ c->wq = nil;
+ c->state = Established;
break;
case MSG_CHANNEL_OPEN_FAILURE:
if(unpack(m, "_u____s", &chan, &s, &n) < 0)