Uploads with the default settings of v0.167.0 and v0.167.1 could fail: fixed, and a faster uploader.
Fixes
The uploader keeps 1 MiB in flight per connection (#2012)
- Since v0.167.0 the uploader kept 8 MiB of parts in flight by default on the connection of its client, usually the primary one. Telegram may close a connection with that much in flight with transport error -429 (transport flood): uploads failed within 2–3 s with
engine forcibly closed. Now as many parts as fit into 1 MiB are in flight by default, askMaxUploadPerSessionof Telegram Desktop.WithThreadsstill sets it; keep threads × part size within 1 MiB per connection.
Features
Client.Uploader() (#2012)
- Returns an uploader that sends parts through a pool of
Options.UploadPoolSize(default 8) connections to the home DC, one part per connection, as the upload sessions of Telegram Desktop. Uses the primary session and the client middlewares; the pool closes whenRunreturns and shows as kinduploadingotd.client.pools. - Measured on production from a server, 512 MiB with 512 KiB parts: 20.6 MiB/s over
client.API(), 41.8 MiB/s withclient.Uploader().
Full Changelog: v0.167.1...v0.167.2