From 5a3c8bc061fbcfd27e554f0688e7d2b093a3b9aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AC=9D=E6=A1=82=E7=B6=B1?= Date: Thu, 11 Feb 2016 08:27:31 +0800 Subject: [PATCH] problems in text encoding --- .../ComputingServices/FileSystem/FileStream/FileStream.vb | 2 +- .../ComputingServices/FileSystem/FileSystemHost.vb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ComputingServices/ComputingServices/FileSystem/FileStream/FileStream.vb b/ComputingServices/ComputingServices/FileSystem/FileStream/FileStream.vb index 4715416..89fada4 100644 --- a/ComputingServices/ComputingServices/FileSystem/FileStream/FileStream.vb +++ b/ComputingServices/ComputingServices/FileSystem/FileStream/FileStream.vb @@ -1322,7 +1322,7 @@ Namespace FileSystem.IO Dim invoke As New AsynInvoke(FileSystem) Dim rep As RequestStream = invoke.SendMessage(req) Call System.Array.ConstrainedCopy(rep.ChunkBuffer, Scan0, array, offset, count) - Return rep.ChunkBuffer.Length + Return rep.Protocol ' 在host的协议里面会将读函数的返回值放在protocol属性里面返回 End Function ' Exceptions: diff --git a/ComputingServices/ComputingServices/FileSystem/FileSystemHost.vb b/ComputingServices/ComputingServices/FileSystem/FileSystemHost.vb index ca2138c..51854ba 100644 --- a/ComputingServices/ComputingServices/FileSystem/FileSystemHost.vb +++ b/ComputingServices/ComputingServices/FileSystem/FileSystemHost.vb @@ -87,8 +87,9 @@ Namespace FileSystem If OpenedHandles.ContainsKey(uid) Then Dim stream As FileStream = OpenedHandles(uid) Dim buffer As Byte() = handle.CreateBuffer - Call stream.Read(buffer, handle.offset, handle.length) + Dim n As Integer = stream.Read(buffer, handle.offset, handle.length) Dim value As RequestStream = RequestStream.CreatePackage(buffer) + value.Protocol = CLng(n) Return value Else Return New RequestStream(Scan0, HTTP_RFC.RFC_TOKEN_INVALID, $"File handle {uid} is not opened!")