Turbopower IPro: Fix compilation with FPC 2.6.4. Issue #29483, patch from Silvio Clécio.

git-svn-id: trunk@51434 -
This commit is contained in:
juha 2016-01-28 11:41:03 +00:00
parent b36d8209aa
commit b3bc124f4d
2 changed files with 5 additions and 3 deletions

View File

@ -44,7 +44,7 @@ var
begin
A := FindNodeByElemId(Html.HtmlNode, 'a') as TIpHtmlNodeINPUT;
B := FindNodeByElemId(Html.HtmlNode, 'b') as TIpHtmlNodeINPUT;
ShowMessageFmt('Sum: %d', [A.Value.ToInteger + B.Value.ToInteger]);
ShowMessageFmt('Sum: %d', [StrToInt(A.Value) + StrToInt(B.Value)]);
end;
end.

View File

@ -83,8 +83,10 @@ begin
FDocumment := TMemoryStream.Create;
HandledProtocols.Add('HTTP');
FClient.ResponseHeaders.NameValueSeparator := ':';
{$IF FPC_FULLVERSION > 30000}
FClient.AllowRedirect := True;
FClient.MaxRedirects := High(Byte);
{$ENDIF}
end;
destructor TIpHttpDataProvider.Destroy;
@ -126,8 +128,8 @@ begin
IpParseURL(AUrl, VAddrRec);
FDocumment.Clear;
FClient.Get(AUrl, FDocumment);
Result := (FClient.ResponseStatusCode = 200) or
FClient.IsRedirect(FClient.ResponseStatusCode);
Result := (FClient.ResponseStatusCode = 200)
{$IF FPC_FULLVERSION > 30000}or FClient.IsRedirect(FClient.ResponseStatusCode){$ENDIF};
if Result then
begin
FContentType := FClient.ResponseHeaders.Values['Content-Type'];