Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/majn/tgl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvvaltman <vvaltman@neon>2014-12-06 17:10:45 +0300
committervvaltman <vvaltman@neon>2014-12-06 17:10:45 +0300
commit5a88deed8c0b11dcd00447340f24a3057a0998b0 (patch)
tree7e75aae4ad96831a1f80c685f73055aca2baf9a9
parentcebe2822a2620961692ac45b0ea2ee99d396c5fb (diff)
try to work when time is bad
-rw-r--r--mtproto-client.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mtproto-client.c b/mtproto-client.c
index 5a7f36f..b620014 100644
--- a/mtproto-client.c
+++ b/mtproto-client.c
@@ -187,7 +187,8 @@ static int rpc_send_packet (struct tgl_state *TLS, struct connection *c) {
int len = (packet_ptr - packet_buffer) * 4;
//c->out_packet_num ++;
TLS->net_methods->incr_out_packet_num (c);
- long long next_msg_id = (long long) ((1LL << 32) * get_utime (CLOCK_REALTIME)) & -4;
+ struct tgl_dc *DC = TLS->net_methods->get_dc (c);
+ long long next_msg_id = (long long) ((1LL << 32) * (DC->server_time_delta + get_utime (CLOCK_REALTIME))) & -4;
if (next_msg_id <= unenc_msg_header.out_msg_id) {
unenc_msg_header.out_msg_id += 4;
} else {