Reduced ping of the main server

Work was done to improve the response to the main Telegram server, which is approximately located Amsterdam. Experimentally, it was possible to reduce the ping by about 10 ms, and the media loading was also accelerated. Some changes on the server side, a couple of errors are fixed.