Fixed needed msg len
This commit is contained in:
parent
d289aeb897
commit
045467b0df
@ -1153,6 +1153,9 @@ int rpc_execute (struct connection *c, int op, int len) {
|
||||
|
||||
int Response_len = len;
|
||||
|
||||
if (verbosity >= 2) {
|
||||
logprintf ("Response_len = %d\n", Response_len);
|
||||
}
|
||||
assert (read_in (c, Response, Response_len) == Response_len);
|
||||
Response[Response_len] = 0;
|
||||
if (verbosity >= 2) {
|
||||
|
4
net.c
4
net.c
@ -298,12 +298,12 @@ void try_rpc_read (struct connection *c) {
|
||||
unsigned t = 0;
|
||||
assert (read_in_lookup (c, &len, 1) == 1);
|
||||
if (len >= 1 && len <= 0x7e) {
|
||||
if (c->in_bytes < (int)(4 * len)) { return; }
|
||||
if (c->in_bytes < (int)(1 + 4 * len)) { return; }
|
||||
} else {
|
||||
if (c->in_bytes < 4) { return; }
|
||||
assert (read_in_lookup (c, &len, 4) == 4);
|
||||
len = (len >> 8);
|
||||
if (c->in_bytes < (int)(4 * len)) { return; }
|
||||
if (c->in_bytes < (int)(4 + 4 * len)) { return; }
|
||||
len = 0x7f;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user