TGViewer
Telegram github commits and releases Telegram github commits and releases @tgappsupdates · 4.49K subscribers
Post #20367 217
tdlib/td/master • 1b94803 • 2 files, +21/-6
Apply backpressure to inbound HTTP connections

HttpConnectionBase::loop() used to drain the socket unconditionally, so
when data arrived faster than the query parser consumed it (e.g. a big
file upload saved to a slow disk), unbounded amounts of received data
accumulated in memory: uploading a 512 MB file could transiently hold
more than 1 GB in buffers.

Stop reading from the socket while more than MAX_PENDING_READ_SIZE of
received data is pending in memory. The kernel receive buffer then
fills up and TCP flow control throttles the peer, keeping memory usage
constant however large the request is. The same upload now peaks below
8 MB of buffer memory.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

#tdlib
  • 🫡 2
More from @tgappsupdates
  1. Oct 18, 2026telegramdesktop/tdesktop/public-canary • 1387700 • 4 files, +6/-26 Added modifier conditio…
  2. Oct 17, 2026telegramdesktop/tdesktop/public-canary • 2453a1c • 1 files, +1/-1 Propagated Windows RHI p…
  3. Oct 17, 2026telegramdesktop/tdesktop/public-canary • 34cedd0 • 7 files, +113/-10 Added Windows 7 suppo…
  4. Oct 17, 2026UnigramDev/Unigram/develop • 4428819 • 1 files, +4/-1 Draw the editor's caret over a selec…
  5. Oct 17, 2026UnigramDev/Unigram/develop • c3d2fc6 • 1 files, +8/-1 Give every generated file an access…
  6. Oct 17, 2026UnigramDev/Unigram/develop • 4c1fd32 • 10 files, +891/-42 Add shapes to the media editor a…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →