From ccad6f9f310ae05746daadea0e535bb74f7820dd Mon Sep 17 00:00:00 2001 From: Wizou <11647984+wiz0u@users.noreply.github.com> Date: Thu, 21 Nov 2024 17:08:08 +0100 Subject: [PATCH] Limit parallel transfers to 1 in HTTP mode --- src/Client.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Client.cs b/src/Client.cs index 28207cf..7c383ce 100644 --- a/src/Client.cs +++ b/src/Client.cs @@ -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(); } /// Disconnect from Telegram (shouldn't be needed in normal usage)