Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/duplicati/duplicati.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Martikyan <karen.martikyan@digitain.com>2020-11-07 13:54:33 +0300
committerKaren Martikyan <karen.martikyan@digitain.com>2020-11-07 13:54:33 +0300
commit9017878a3cc2ddcde6b14fc3646b9c8adf5e0208 (patch)
tree2b2ea026dac4ca813ff3d9f55e72962ac483e77c /Duplicati/Library
parent64ccc60fd2644d6c7b1799b7fba81fcf5454607b (diff)
Small fixes, redundant extension removed
Diffstat (limited to 'Duplicati/Library')
-rw-r--r--Duplicati/Library/Backend/Telegram/Extensions/TelegramClientExtensions.cs34
-rw-r--r--Duplicati/Library/Backend/Telegram/TelegramBackend.cs2
2 files changed, 1 insertions, 35 deletions
diff --git a/Duplicati/Library/Backend/Telegram/Extensions/TelegramClientExtensions.cs b/Duplicati/Library/Backend/Telegram/Extensions/TelegramClientExtensions.cs
index 7f03af2bd..7b1fd82ec 100644
--- a/Duplicati/Library/Backend/Telegram/Extensions/TelegramClientExtensions.cs
+++ b/Duplicati/Library/Backend/Telegram/Extensions/TelegramClientExtensions.cs
@@ -44,39 +44,5 @@ namespace Duplicati.Library.Backend.Extensions
return true;
}
-
- public static bool FlushStreams(this TelegramClient client)
- {
- if (client.IsConnected == false)
- {
- return false;
- }
-
- var transportFieldInfo = typeof(TelegramClient).GetField("transport", _bindingFlags);
- var transportField = (TcpTransport)transportFieldInfo.GetValue(client);
-
- if (transportField == null || transportField.IsConnected == false)
- {
- return false;
- }
-
- var tcpClientFieldInfo = typeof(TcpTransport).GetField("tcpClient", _bindingFlags);
- var tcpClient = (TcpClient)tcpClientFieldInfo.GetValue(transportField);
-
- if (tcpClient == null || tcpClient.Connected == false)
- {
- return false;
- }
-
- var availableDataLength = tcpClient.Available;
- //tcpClient.LingerState.
- Console.WriteLine($"Available data is {availableDataLength}");
- if (availableDataLength != 0)
- {
- tcpClient.GetStream().Read(new byte[availableDataLength], 0, availableDataLength);
- }
-
- return true;
- }
}
} \ No newline at end of file
diff --git a/Duplicati/Library/Backend/Telegram/TelegramBackend.cs b/Duplicati/Library/Backend/Telegram/TelegramBackend.cs
index d61e231e6..7a842a3bd 100644
--- a/Duplicati/Library/Backend/Telegram/TelegramBackend.cs
+++ b/Duplicati/Library/Backend/Telegram/TelegramBackend.cs
@@ -427,7 +427,7 @@ namespace Duplicati.Library.Backend
}
- private void EnsureConnected(CancellationToken cancelToken = default)
+ private void EnsureConnected(CancellationToken cancelToken = default(CancellationToken))
{
if (m_telegramClient.IsReallyConnected())
{