Chunk too big reported for HTTP GET. RFC2616 does not limit chunk
Original Reporter info from Mantis: tudi_x
-
Reporter name: Tudor Hulban
Original Reporter info from Mantis: tudi_x
- Reporter name: Tudor Hulban
Description:
hi All,
while doing a GET with TFPHttpClient I am getting a EHTTPClient.Create(SErrChunkTooBig) for a 10 M reguest (for a bandwidth check).
as per RFC2616 there is no chunk size limit.
please advise on the limitation or could it be reviewed and for persons interested the initial stream size could be used for triggering the error?
from fphttpclient.pp around line 1057, Lazarus 1.8RC5 with FPC 3.0.4:
if ChunkSize>1000000 then Raise EHTTPClient.Create(SErrChunkTooBig);
see: http://forum.lazarus.freepascal.org/index.php/topic,38853.msg265195/topicseen.html#new
Steps to reproduce:
procedure TGETSpeed.CheckSpeed(AURL: string; ABytes: longword);
var
t1, t2: TDateTime;
url: string;
params: string;
HTTPRequest: TFPHttpClient;
begin
try
params := 's=' + EncodeURLElement(IntToStr(ABytes));
url := AURL + '?' + params;
try
HTTPRequest := TFPHttpClient.Create(nil);
t1 := now();
HTTPRequest.Get(url);
t2 := now();
TriggerError(IntToStr(MilliSecondsBetween(t2, t1)));
except
on E: Exception do
begin
HTTPRequest.Free;
TriggerError('Error:' + E.Message);
end;
end;
finally
FreeAndNil(HTTPRequest);
end;
end;
Additional information:
with Synpase it works:
procedure TGETSpeed.CheckSpeedSynapse(AURL: string; ABytes: longword);
var
t1, t2: TDateTime;
url: string;
params: string;
HTTPRequest: THTTPSend;
begin
try
params := 's=' + EncodeURLElement(IntToStr(ABytes));
url := AURL + '?' + params;
try
HTTPRequest := THTTPSend.Create;
t1 := now();
HTTPRequest.HTTPMethod('GET',url);
t2 := now();
TriggerError(IntToStr(MilliSecondsBetween(t2, t1)));
except
on E: Exception do
begin
HTTPRequest.Free;
TriggerError('Error:' + E.Message);
end;
end;
finally
FreeAndNil(HTTPRequest);
end;
end;
Mantis conversion info:
- Mantis ID: 32656
- OS: Windows
- OS Build: 7
- Build: 3.0.4
- Platform: 64 bit
- Version: 3.0.2
- Fixed in version: 3.1.1
- Fixed in revision: 37849 (#9d7d95fe)
- Target version: 3.2.0