From 049247da4dd58573183057347e5e924711ad8478 Mon Sep 17 00:00:00 2001 From: akpaevj Date: Fri, 6 Dec 2024 13:21:26 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20#1471.=20=D0=94=D0=BE=D0=B1=D0=B0?= =?UTF-8?q?=D0=B2=D0=BB=D0=B5=D0=BD=D0=BE=20=D0=BF=D1=80=D0=B5=D1=80=D1=8B?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5=20=D1=86=D0=B8=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=20=D1=81=D1=87=D0=B8=D1=82=D1=8B=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B8=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C?= =?UTF-8?q?=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B8=20=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=D0=B6=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=B7?= =?UTF-8?q?=D0=B0=D0=B4=D0=B0=D0=BD=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BB=D0=B8?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/OneScript.StandardLibrary/Net/TCPClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/OneScript.StandardLibrary/Net/TCPClient.cs b/src/OneScript.StandardLibrary/Net/TCPClient.cs index 44abe36a7..ae8b940dc 100644 --- a/src/OneScript.StandardLibrary/Net/TCPClient.cs +++ b/src/OneScript.StandardLibrary/Net/TCPClient.cs @@ -81,7 +81,11 @@ private MemoryStream ReadAllData(NetworkStream source, int limit) int numberOfBytesRead = source.Read(readBuffer, 0, portion); ms.Write(readBuffer, 0, numberOfBytesRead); if (useLimit) - limit -= numberOfBytesRead; + { + limit -= numberOfBytesRead; + if (limit <= 0) + break; + } } while (source.DataAvailable); if(ms.Length > 0)