Limit parallel transfers to 1 in HTTP mode

This commit is contained in:
Wizou 2024-11-21 17:08:08 +01:00
parent ddc0a3caef
commit ccad6f9f31

View file

@ -209,6 +209,7 @@ namespace WTelegram
if (_tcpClient != null) throw new InvalidOperationException("Cannot switch to HTTP after TCP connection");
_httpClient = httpClient ?? new();
_httpWait = defaultHttpWait;
while (_parallelTransfers.CurrentCount > 1) _parallelTransfers.Wait();
}
/// <summary>Disconnect from Telegram <i>(shouldn't be needed in normal usage)</i></summary>