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;
|
int Response_len = len;
|
||||||
|
|
||||||
|
if (verbosity >= 2) {
|
||||||
|
logprintf ("Response_len = %d\n", Response_len);
|
||||||
|
}
|
||||||
assert (read_in (c, Response, Response_len) == Response_len);
|
assert (read_in (c, Response, Response_len) == Response_len);
|
||||||
Response[Response_len] = 0;
|
Response[Response_len] = 0;
|
||||||
if (verbosity >= 2) {
|
if (verbosity >= 2) {
|
||||||
|
4
net.c
4
net.c
@ -298,12 +298,12 @@ void try_rpc_read (struct connection *c) {
|
|||||||
unsigned t = 0;
|
unsigned t = 0;
|
||||||
assert (read_in_lookup (c, &len, 1) == 1);
|
assert (read_in_lookup (c, &len, 1) == 1);
|
||||||
if (len >= 1 && len <= 0x7e) {
|
if (len >= 1 && len <= 0x7e) {
|
||||||
if (c->in_bytes < (int)(4 * len)) { return; }
|
if (c->in_bytes < (int)(1 + 4 * len)) { return; }
|
||||||
} else {
|
} else {
|
||||||
if (c->in_bytes < 4) { return; }
|
if (c->in_bytes < 4) { return; }
|
||||||
assert (read_in_lookup (c, &len, 4) == 4);
|
assert (read_in_lookup (c, &len, 4) == 4);
|
||||||
len = (len >> 8);
|
len = (len >> 8);
|
||||||
if (c->in_bytes < (int)(4 * len)) { return; }
|
if (c->in_bytes < (int)(4 + 4 * len)) { return; }
|
||||||
len = 0x7f;
|
len = 0x7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,9 @@ struct query *query_get (long long id) {
|
|||||||
|
|
||||||
int alarm_query (struct query *q) {
|
int alarm_query (struct query *q) {
|
||||||
assert (q);
|
assert (q);
|
||||||
|
if (verbosity) {
|
||||||
|
logprintf ("Alarm query %lld\n", q->msg_id);
|
||||||
|
}
|
||||||
q->ev.timeout = get_double_time () + QUERY_TIMEOUT;
|
q->ev.timeout = get_double_time () + QUERY_TIMEOUT;
|
||||||
insert_event_timer (&q->ev);
|
insert_event_timer (&q->ev);
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user