Commit 045467b0 authored by Vysheng's avatar Vysheng

Fixed needed msg len

parent d289aeb8
......@@ -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) {
......
......@@ -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;
}
......
......@@ -56,6 +56,9 @@ struct query *query_get (long long id) {
int alarm_query (struct query *q) {
assert (q);
if (verbosity) {
logprintf ("Alarm query %lld\n", q->msg_id);
}
q->ev.timeout = get_double_time () + QUERY_TIMEOUT;
insert_event_timer (&q->ev);
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment