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!")