mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-07 17:13:02 +02:00
--- Merging r34062 into '.':
U packages/fcl-web/src/base/fphttpclient.pp --- Recording mergeinfo for merge of r34062 into '.': U . # revisions: 34062 git-svn-id: branches/fixes_3_0@34108 -
This commit is contained in:
parent
f564fd7114
commit
0a24fb2c59
@ -101,6 +101,7 @@ Type
|
|||||||
Procedure SetRequestHeaders(const AValue: TStrings);
|
Procedure SetRequestHeaders(const AValue: TStrings);
|
||||||
procedure SetIOTimeout(AValue: Integer);
|
procedure SetIOTimeout(AValue: Integer);
|
||||||
protected
|
protected
|
||||||
|
Function NoContentAllowed(ACode : Integer) : Boolean;
|
||||||
// True if we need to use a proxy: ProxyData Assigned and Hostname Set
|
// True if we need to use a proxy: ProxyData Assigned and Hostname Set
|
||||||
Function ProxyActive : Boolean;
|
Function ProxyActive : Boolean;
|
||||||
// Override this if you want to create a custom instance of proxy.
|
// Override this if you want to create a custom instance of proxy.
|
||||||
@ -457,6 +458,11 @@ begin
|
|||||||
FSocket.IOTimeout:=AValue;
|
FSocket.IOTimeout:=AValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFPCustomHTTPClient.NoContentAllowed(ACode: Integer): Boolean;
|
||||||
|
begin
|
||||||
|
Result:=((ACode div 100)=1) or ((ACode=204) or (ACode=304))
|
||||||
|
end;
|
||||||
|
|
||||||
function TFPCustomHTTPClient.ProxyActive: Boolean;
|
function TFPCustomHTTPClient.ProxyActive: Boolean;
|
||||||
begin
|
begin
|
||||||
Result:=Assigned(FProxy) and (FProxy.Host<>'') and (FProxy.Port>0);
|
Result:=Assigned(FProxy) and (FProxy.Host<>'') and (FProxy.Port>0);
|
||||||
@ -1034,7 +1040,7 @@ begin
|
|||||||
L:=L-R;
|
L:=L-R;
|
||||||
until (L=0) or (R=0);
|
until (L=0) or (R=0);
|
||||||
end
|
end
|
||||||
else if L<0 then
|
else if (L<0) and (Not NoContentAllowed(ResponseStatusCode)) then
|
||||||
begin
|
begin
|
||||||
// No content-length, so we read till no more data available.
|
// No content-length, so we read till no more data available.
|
||||||
Repeat
|
Repeat
|
||||||
|
Loading…
Reference in New Issue
Block a user