|
@@ -1786,14 +1786,15 @@ begin
|
|
SetLength(Buffer, TotalBytesHave+BytesRead);
|
|
SetLength(Buffer, TotalBytesHave+BytesRead);
|
|
|
|
|
|
{ Check for completed lines thanks to the new data }
|
|
{ Check for completed lines thanks to the new data }
|
|
- var P := FindNewLine(Buffer, LastRead);
|
|
|
|
- while P <> 0 do begin
|
|
|
|
|
|
+ while FTotalLinesRead < FMaxTotalLinesToRead do begin
|
|
|
|
+ var P := FindNewLine(Buffer, LastRead);
|
|
|
|
+ if P = 0 then
|
|
|
|
+ Break;
|
|
LogLine(Copy(Buffer, 1, P-1));
|
|
LogLine(Copy(Buffer, 1, P-1));
|
|
Inc(FTotalLinesRead);
|
|
Inc(FTotalLinesRead);
|
|
if (Buffer[P] = #13) and (P < Length(Buffer)) and (Buffer[P+1] = #10) then
|
|
if (Buffer[P] = #13) and (P < Length(Buffer)) and (Buffer[P+1] = #10) then
|
|
Inc(P);
|
|
Inc(P);
|
|
Delete(Buffer, 1, P);
|
|
Delete(Buffer, 1, P);
|
|
- P := FindNewLine(Buffer, LastRead);
|
|
|
|
end;
|
|
end;
|
|
|
|
|
|
Inc(FTotalBytesRead, BytesRead);
|
|
Inc(FTotalBytesRead, BytesRead);
|