mirror of
https://github.com/HeidiSQL/HeidiSQL.git
synced 2025-08-26 11:17:57 +08:00
Issue #746: prefer AnsiString over Byte data type for buffering http request result.
This commit is contained in:
@ -3214,7 +3214,7 @@ procedure THttpDownload.SendRequest(Filename: String);
|
|||||||
var
|
var
|
||||||
NetHandle: HINTERNET;
|
NetHandle: HINTERNET;
|
||||||
UrlHandle: HINTERNET;
|
UrlHandle: HINTERNET;
|
||||||
Buffer: array[1..4096] of Byte;
|
Buffer: array[0..4095] of AnsiChar;
|
||||||
Head: array[1..1024] of Char;
|
Head: array[1..1024] of Char;
|
||||||
BytesInChunk, HeadSize, Reserved, TimeOutSeconds: Cardinal;
|
BytesInChunk, HeadSize, Reserved, TimeOutSeconds: Cardinal;
|
||||||
LocalFile: File;
|
LocalFile: File;
|
||||||
@ -3273,7 +3273,8 @@ begin
|
|||||||
if DoStore then begin
|
if DoStore then begin
|
||||||
BlockWrite(LocalFile, Buffer, BytesInChunk)
|
BlockWrite(LocalFile, Buffer, BytesInChunk)
|
||||||
end else begin
|
end else begin
|
||||||
SetString(ContentChunk, PChar(@Buffer[1]), BytesInChunk);
|
SetString(ContentChunk, PChar(@Buffer[0]), BytesInChunk);
|
||||||
|
//ContentChunk := String(@Buffer[0]);
|
||||||
FLastContent := FLastContent + ContentChunk;
|
FLastContent := FLastContent + ContentChunk;
|
||||||
end;
|
end;
|
||||||
Inc(FBytesRead, BytesInChunk);
|
Inc(FBytesRead, BytesInChunk);
|
||||||
|
Reference in New Issue
Block a user