Commit 0fef150a authored by vysheng's avatar vysheng

mtproto-client: fix server time on first mesasge

parent 820840ec
...@@ -949,7 +949,12 @@ int process_rpc_message (struct connection *c UU, struct encrypted_message *enc, ...@@ -949,7 +949,12 @@ int process_rpc_message (struct connection *c UU, struct encrypted_message *enc,
DC->server_salt = enc->server_salt; DC->server_salt = enc->server_salt;
write_auth_file (); write_auth_file ();
} }
int this_server_time = enc->msg_id >> 32LL; int this_server_time = enc->msg_id >> 32LL;
if (!DC->server_time_delta) {
DC->server_time_delta = this_server_time - time (0);
DC->server_time_udelta = this_server_time - get_utime (CLOCK_MONOTONIC);
}
double st = get_server_time (DC); double st = get_server_time (DC);
assert (this_server_time >= st - 300 && this_server_time <= st + 30); assert (this_server_time >= st - 300 && this_server_time <= st + 30);
//assert (enc->msg_id > server_last_msg_id && (enc->msg_id & 3) == 1); //assert (enc->msg_id > server_last_msg_id && (enc->msg_id & 3) == 1);
......
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