Commit Graph

8 Commits

Author SHA1 Message Date
Loïc Molinari 06618a5253 Use fine grained session timers
The check of sent requests and containers is done unconditionally
every second even though the request timeout is 10 seconds and the
container timeout is 600 seconds. This commit uses fine grained timers
instead in order to avoid useless system wake-up events.

The check of sent requests is now scheduled on demand when a new
request is queued. Then the callback, while parsing queued requests,
computes the delta to the closest expiring request and automatically
schedules the next check if necessary.

Given the high value of the container timeout, its callback is called
repeatedly every 600 seconds, unless it computes a lower delta for an
expiring container using the same logic as for the requests.
2021-04-15 16:20:42 +03:00
John Preston 267e5fd9e0 Allow getting outer_msg_id in MTProto handlers. 2021-03-12 16:58:26 +04:00
John Preston 357caf8007 Keep separate MTP::Config's for separate accounts. 2020-06-23 21:53:41 +04:00
John Preston 7883f97c94 Use precise sync of the server unixtime. 2020-05-12 17:33:06 +04:00
John Preston 6882093ed1 Send init connection params. 2020-04-21 18:55:34 +04:00
John Preston e60a9f0943 Fix key creation for media cluster. 2019-12-09 18:42:11 +03:00
John Preston 907965531c Don't bind key for more than 10 seconds. 2019-12-02 16:30:33 +03:00
John Preston 91f50e8bdc Move some more code to lib_mtproto. 2019-12-02 16:11:22 +03:00