ZaStoGram_desktop/Telegram/SourceFiles/mtproto/details
Repository files (latest commit first)
Filename Latest commit message Latest commit date
loop-uh c8120a7a6d
All checks were successful
Desktop source guards / guards (push) Successful in 8s
Treat the WEB proxy carrier as one shared pipe
Every MTProto session through a WEB proxy is a stream on a single
carrier whose relay keeps one FIFO per direction. Bulk media and
uploads filled that FIFO, every session's own 4-8s receive timer then
fired at once, and the reconnects piled new OPENs behind the same
backlog.

- Uplink: a scheduler serves interactive streams first, download
  requests next and uploads round-robin in 64 KiB frames, with at most
  1 MiB of upload bytes uncredited by the relay (one bounded batch in
  front of a chat request); a burst guard keeps uploads from starving.
- Downlink: download streams keep only a share of a 2 MiB credit budget
  (256 KiB..1 MiB each) instead of the full 4 MiB window, so media waits
  in the backend's TCP buffers rather than in front of chat replies.
- Liveness: a WEB session asks the carrier before dropping its stream.
  It waits while its request is still queued or the downlink is busy,
  fails when the pipe is quiet for 8s after delivery, busy for 30s, or
  after 64s total. A carrier with bytes outstanding and no relay
  progress for 20s is recovered once, for all streams.
- A WEB session opens one stream instead of racing identical ones, and
  a -404 on a WEB stream reconnects first; only a second -404 before any
  reply decrypts destroys the temporary key.
- Uploads and downloads use at most two sessions per DC through a WEB
  proxy, and slow upload parts are no longer cancelled and moved.
- web_carrier diagnostics report carrier state, stalls, per-class
  stream and queue counts, credit and throughput every 10s of activity.

The policy lives in web_proxy_flow.{h,cpp} and is covered by the new
test_web_proxy_flow target and a source guard.
2026-09-23 20:29:51 +03:00
..
mtproto_dcenter.cpp Merge upstream dev through b033e513f4 2026-08-22 11:23:33 +03:00
mtproto_dcenter.h Create only temporary keys for CDN. 2019-12-28 13:52:29 +03:00
mtproto_domain_resolver.cpp Merge upstream dev through a1ea1ddd8c (7.2.9) 2026-09-23 16:21:17 +03:00
mtproto_domain_resolver.h fix 2026-07-08 16:28:12 +03:00
mtproto_received_ids_manager.cpp Reset session on receiving a really old msgId. 2021-12-07 10:05:41 +04:00
mtproto_received_ids_manager.h Reset session on receiving a really old msgId. 2021-12-07 10:05:41 +04:00
mtproto_rsa_public_key.cpp Fix MTProto buffer/protocol bugs found in audit 2026-07-09 00:54:55 +03:00
mtproto_rsa_public_key.h Move some more code to lib_mtproto. 2019-12-02 16:11:22 +03:00
mtproto_web_proxy_socket.cpp Treat the WEB proxy carrier as one shared pipe 2026-09-23 20:29:51 +03:00
mtproto_web_proxy_socket.h Treat the WEB proxy carrier as one shared pipe 2026-09-23 20:29:51 +03:00