From 5f2609c39bbb62dc9ff6c5728e420b2273e30237 Mon Sep 17 00:00:00 2001 From: inoussa Date: Sat, 24 May 2014 13:02:54 +0000 Subject: [PATCH] Indy >= 10.5.x compatibility fix. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3087 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- wst/trunk/indy_http_protocol.pas | 32 ++++++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/wst/trunk/indy_http_protocol.pas b/wst/trunk/indy_http_protocol.pas index 26e5a324b..947e7e666 100644 --- a/wst/trunk/indy_http_protocol.pas +++ b/wst/trunk/indy_http_protocol.pas @@ -20,7 +20,12 @@ interface uses Classes, SysUtils, service_intf, imp_utils, base_service_intf, wst_types, - client_utils, IdHTTP, IdCookie; + client_utils, IdGlobal, IdHTTP, IdCookie; + +{$UNDEF COOKIE_NAME_FIRST} +{$IF Declared(gsIdVersionMajor)} + {$DEFINE COOKIE_NAME_FIRST} +{$IFEND} Const sTRANSPORT_NAME = 'HTTP'; @@ -263,8 +268,12 @@ end; function TIndyCookieManager.GetValue(const AName : string) : string; var i : Integer; -begin +begin +{$IFDEF COOKIE_NAME_FIRST} + i := ReferencedObject.GetCookieIndex(AName,0); +{$ELSE COOKIE_NAME_FIRST} i := ReferencedObject.GetCookieIndex(0,AName); +{$ENDIF COOKIE_NAME_FIRST} if (i >= 0) then Result := ReferencedObject[i].Value else @@ -279,15 +288,26 @@ begin ReferencedObject[AIndex].Value := AValue; end; +type + TLocalCookie = +{$IFDEF COOKIE_NAME_FIRST} + TIdCookie; +{$ELSE COOKIE_NAME_FIRST} + TIdNetscapeCookie; +{$ENDIF COOKIE_NAME_FIRST} procedure TIndyCookieManager.SetValue( - const AName : string; + const AName : string; const AValue : string -); +); var i : Integer; - locItem : TIdNetscapeCookie; + locItem : TLocalCookie; begin - i := ReferencedObject.GetCookieIndex(0,AName); +{$IFDEF COOKIE_NAME_FIRST} + i := ReferencedObject.GetCookieIndex(AName,0); +{$ELSE COOKIE_NAME_FIRST} + i := ReferencedObject.GetCookieIndex(0,AName); +{$ENDIF COOKIE_NAME_FIRST} if (i >= 0) then begin ReferencedObject[i].Value := AValue; end else begin