sshnet: don't leak "Dialing" connections when "connect" ctl write gets interrupted

This commit is contained in:
cinap_lenrek 2019-04-03 14:16:28 +02:00
parent 2251ef7a32
commit 81f3b1a233

View file

@ -1086,11 +1086,13 @@ handlemsg(Msg *m)
c->sendpkt = pkt; c->sendpkt = pkt;
c->sendwin = win; c->sendwin = win;
c->servernum = n; c->servernum = n;
c->state = Established; if(c->wq == nil){
if(c->wq != nil){ teardownclient(c);
respond(c->wq, nil); break;
c->wq = nil;
} }
respond(c->wq, nil);
c->wq = nil;
c->state = Established;
break; break;
case MSG_CHANNEL_OPEN_FAILURE: case MSG_CHANNEL_OPEN_FAILURE:
if(unpack(m, "_u____s", &chan, &s, &n) < 0) if(unpack(m, "_u____s", &chan, &s, &n) < 0)