Skybuck Flying
2005-11-23 11:58:16 UTC
The problem is bigger than I thought.
Even with a big buffer like 1 MB it doesn't work well.
Bye,
Skybuck.
Even with a big buffer like 1 MB it doesn't work well.
Bye,
Skybuck.
Hi,
Problem: InternetReadFile returns true and BytesRead is zero while in
reality there should be more bytes.
Question: What is causing this problem ?
The buffer supplied to InternetReadFile is 4 KB.
If the buffer supplied to InternetReadFile is much larger, for example 4
MB,Problem: InternetReadFile returns true and BytesRead is zero while in
reality there should be more bytes.
Question: What is causing this problem ?
The buffer supplied to InternetReadFile is 4 KB.
If the buffer supplied to InternetReadFile is much larger, for example 4
this problem does not occur ?!
vFlags := INTERNET_FLAG_NO_CACHE_WRITE;
vFlags := INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_RELOAD;
vContext := 0;
function Thttp.RetrieveText : boolean;
begin
result := false;
mText := '';
while true do
begin
if InternetReadFile(
mInternetHTTPHandle,
mInternalBuffer,
mInternalBufferSize,
mInternalBufferBytes ) then
begin
// buffer bytes read
if mInternalBufferBytes > 0 then
begin
mText := mText + Pchar(mInternalBuffer);
end else
if mInternalBufferBytes = 0 then
begin
result := true;
// end of file reached
break;
end;
end else
begin
mLastError := GetLastError;
break;
end;
end;
end;
I would like to know what could be causing this problem, any ideas ?
Bye,
Skybuck.
vFlags := INTERNET_FLAG_NO_CACHE_WRITE;
vFlags := INTERNET_FLAG_NO_CACHE_WRITE or INTERNET_FLAG_RELOAD;
vContext := 0;
function Thttp.RetrieveText : boolean;
begin
result := false;
mText := '';
while true do
begin
if InternetReadFile(
mInternetHTTPHandle,
mInternalBuffer,
mInternalBufferSize,
mInternalBufferBytes ) then
begin
// buffer bytes read
if mInternalBufferBytes > 0 then
begin
mText := mText + Pchar(mInternalBuffer);
end else
if mInternalBufferBytes = 0 then
begin
result := true;
// end of file reached
break;
end;
end else
begin
mLastError := GetLastError;
break;
end;
end;
end;
I would like to know what could be causing this problem, any ideas ?
Bye,
Skybuck.