mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-12 11:10:07 +00:00
send nul with choice
This commit is contained in:
parent
5fc55a953e
commit
b7edc22192
1 changed files with 7 additions and 3 deletions
|
@ -35,7 +35,7 @@ hasnul(void *v, int n)
|
||||||
if(n > 0 && c[n-1] == '\0')
|
if(n > 0 && c[n-1] == '\0')
|
||||||
return n;
|
return n;
|
||||||
else
|
else
|
||||||
return n+1;
|
return AuthRpcMax;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -220,10 +220,14 @@ found:
|
||||||
/* f[i] is the chosen protocol, q the chosen domain */
|
/* f[i] is the chosen protocol, q the chosen domain */
|
||||||
attr = addattr(attr, "proto=%q dom=%q", f[i], q);
|
attr = addattr(attr, "proto=%q dom=%q", f[i], q);
|
||||||
c->state = "write choice";
|
c->state = "write choice";
|
||||||
|
|
||||||
/* have a key: go for it */
|
/* have a key: go for it */
|
||||||
if(convprint(c, "%q %q", f[i], q) < 0
|
s = estrappend(nil, "%q %q", f[i], q);
|
||||||
|| convwrite(c, "\0", 1) < 0)
|
if(convwrite(c, s, strlen(s)+1) < 0){
|
||||||
|
free(s);
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
free(s);
|
||||||
|
|
||||||
if(version == 2){
|
if(version == 2){
|
||||||
c->state = "read ok";
|
c->state = "read ok";
|
||||||
|
|
Loading…
Reference in a new issue