sshnet: fix write count for ctl message writes

This commit is contained in:
cinap_lenrek 2019-04-02 17:32:34 +02:00
parent e0bdfe1e76
commit dd8af39bce

View file

@ -782,13 +782,13 @@ ctlwrite(Req *r, Client *c)
int nf; int nf;
s = emalloc9p(r->ifcall.count+1); s = emalloc9p(r->ifcall.count+1);
r->ofcall.count = r->ifcall.count;
memmove(s, r->ifcall.data, r->ifcall.count); memmove(s, r->ifcall.data, r->ifcall.count);
s[r->ifcall.count] = '\0'; s[r->ifcall.count] = '\0';
nf = tokenize(s, f, 3); nf = tokenize(s, f, 3);
if(nf == 0){ if(nf == 0){
free(s); free(s);
r->ofcall.count = r->ifcall.count;
respond(r, nil); respond(r, nil);
return; return;
} }
@ -799,7 +799,6 @@ ctlwrite(Req *r, Client *c)
if(nf != 1) if(nf != 1)
goto Badarg; goto Badarg;
teardownclient(c); teardownclient(c);
r->ofcall.count = r->ifcall.count;
respond(r, nil); respond(r, nil);
}else if(strcmp(f[0], "connect") == 0){ }else if(strcmp(f[0], "connect") == 0){
if(c->state != Closed) if(c->state != Closed)