Skip to content

Commit

Permalink
Fixed FPC bug in "TFileStream.position"<>0 when setting size=0
Browse files Browse the repository at this point in the history
  • Loading branch information
PascalCoinDev committed Mar 12, 2020
1 parent 0424a4f commit 5616943
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/core/UNetProtocol.pas
Expand Up @@ -1904,6 +1904,7 @@ procedure TNetData.GetNewBlockChainFromClient(Connection: TNetConnection;
[i,High(chunks),Connection.ClientRemoteAddr]);
TLog.NewLog(ltDebug,CT_LogSender,Format('Concatening chunk %d/%d',[i,High(chunks)]));
safeboxStream.Size:=0;
safeboxStream.Position := 0; // Added caused by FPC 3.0.4 bug that does not update position auto when setting size=0 at a TFileStream
chunk1.Position:=0;
chunks[i].chunkStream.Position:=0;
If Not TPCSafeBox.ConcatSafeBoxStream(chunk1,chunks[i].chunkStream,safeboxStream,errors) then begin
Expand Down

0 comments on commit 5616943

Please sign in to comment.