diff --git a/.gitignore b/.gitignore index 54c1b63..7e58f53 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ static/ src/*.~* *.res *.exe -*.dll *.bpl *.bpi *.dcp diff --git a/Samples/ElasticSearch/DLL/libeay32.dll b/Samples/ElasticSearch/DLL/libeay32.dll new file mode 100644 index 0000000..3bfa075 Binary files /dev/null and b/Samples/ElasticSearch/DLL/libeay32.dll differ diff --git a/Samples/ElasticSearch/DLL/ssleay32.dll b/Samples/ElasticSearch/DLL/ssleay32.dll new file mode 100644 index 0000000..25218ac Binary files /dev/null and b/Samples/ElasticSearch/DLL/ssleay32.dll differ diff --git a/Samples/ElasticSearch/ProviderElasticSearch.dproj b/Samples/ElasticSearch/ProviderElasticSearch.dproj index 87e5272..85ffd56 100644 --- a/Samples/ElasticSearch/ProviderElasticSearch.dproj +++ b/Samples/ElasticSearch/ProviderElasticSearch.dproj @@ -58,6 +58,8 @@ $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_44.png $(BDS)\bin\Artwork\Windows\UWP\delphi_UwpDefault_150.png ProviderElasticSearch + DATALOGGER_ELASTICSEARCH_USE_INDY;$(DCC_Define) + 1046 vclwinx;DataSnapServer;fmx;emshosting;vclie;DbxCommonDriver;bindengine;IndyIPCommon;VCLRESTComponents;DBXMSSQLDriver;FireDACCommonODBC;emsclient;FireDACCommonDriver;appanalytics;IndyProtocols;vclx;IndyIPClient;dbxcds;vcledge;bindcompvclwinx;FmxTeeUI;emsedge;bindcompfmx;DBXFirebirdDriver;inetdb;ibmonitor;FireDACSqliteDriver;DbxClientDriver;FireDACASADriver;Tee;soapmidas;vclactnband;TeeUI;fmxFireDAC;dbexpress;FireDACInfxDriver;DBXMySQLDriver;VclSmp;inet;DataSnapCommon;vcltouch;fmxase;DBXOdbcDriver;dbrtl;FireDACDBXDriver;FireDACOracleDriver;fmxdae;TeeDB;FireDACMSAccDriver;CustomIPTransport;FireDACMSSQLDriver;DataSnapIndy10ServerTransport;DataSnapConnectors;vcldsnap;DBXInterBaseDriver;FireDACMongoDBDriver;IndySystem;FireDACTDataDriver;vcldb;ibxbindings;vclFireDAC;bindcomp;FireDACCommon;DataSnapServerMidas;FireDACODBCDriver;emsserverresource;IndyCore;RESTBackendComponents;bindcompdbx;rtl;FireDACMySQLDriver;FireDACADSDriver;RESTComponents;DBXSqliteDriver;vcl;IndyIPServer;dsnapxml;dsnapcon;DataSnapClient;DataSnapProviderClient;adortl;DBXSybaseASEDriver;DBXDb2Driver;vclimg;DataSnapFireDAC;emsclientfiredac;FireDACPgDriver;FireDAC;FireDACDSDriver;inetdbxpress;xmlrtl;tethering;ibxpress;bindcompvcl;dsnap;CloudService;DBXSybaseASADriver;DBXOracleDriver;FireDACDb2Driver;DBXInformixDriver;vclib;fmxobj;bindcompvclsmp;DataSnapNativeClient;FMXTee;DatasnapConnectorsFreePascal;soaprtl;soapserver;FireDACIBDriver;$(DCC_UsePackage) @@ -133,6 +135,12 @@ ProviderElasticSearch.dpr + + Embarcadero C++Builder Office 2000 Servers Package + Embarcadero C++Builder Office XP Servers Package + Microsoft Office 2000 Sample Automation Server Wrapper Components + Microsoft Office XP Sample Automation Server Wrapper Components + diff --git a/src/Providers/DataLogger.Provider.ElasticSearch.pas b/src/Providers/DataLogger.Provider.ElasticSearch.pas index 49fe88c..0460f0b 100644 --- a/src/Providers/DataLogger.Provider.ElasticSearch.pas +++ b/src/Providers/DataLogger.Provider.ElasticSearch.pas @@ -55,7 +55,6 @@ constructor TProviderElasticSearch.Create; URL('https://localhost:9200'); ContentType('application/json'); - BasicAuth('elastic', ''); Index('logger'); end; diff --git a/src/Providers/DataLogger.Provider.REST.Indy.pas b/src/Providers/DataLogger.Provider.REST.Indy.pas index 8b559b9..dafb89d 100644 --- a/src/Providers/DataLogger.Provider.REST.Indy.pas +++ b/src/Providers/DataLogger.Provider.REST.Indy.pas @@ -11,7 +11,7 @@ interface uses DataLogger.Provider, DataLogger.Types, - IdHTTP, IdSSLOpenSSL, IdMultipartFormData, + IdHTTP, IdSSLOpenSSL, IdSSLOpenSSLHeaders, IdMultipartFormData, System.SysUtils, System.Classes, System.Threading, System.JSON, System.TypInfo, System.NetEncoding; type @@ -320,12 +320,13 @@ procedure TProviderRESTIndy.HTTP(const AMethod: TRESTMethod; const AItemREST: TL try LHTTP.ConnectTimeout := 60000; LHTTP.ReadTimeout := 60000; + LHTTP.HandleRedirects := True; - LHTTP.Request.AcceptCharSet := 'utf-8'; - LHTTP.Request.AcceptEncoding := 'utf-8'; LHTTP.Request.UserAgent := 'DataLogger.Provider.REST.Indy'; LHTTP.Request.ContentType := FContentType; - LHTTP.Request.Accept := FContentType; + LHTTP.Request.AcceptCharSet := 'utf-8'; + LHTTP.Request.AcceptEncoding := 'gzip, deflate, br'; + LHTTP.Request.Accept := '*/*'; LHTTP.Request.Connection := 'Keep-Alive'; if not FToken.Trim.IsEmpty then @@ -347,7 +348,7 @@ procedure TProviderRESTIndy.HTTP(const AMethod: TRESTMethod; const AItemREST: TL if LURL.ToLower.Contains('https://') then begin if not LoadOpenSSLLibrary then - raise EDataLoggerException.Create('DLL''s not compatible or not found (ssleay32 e libeay32)'); + raise EDataLoggerException.Create(Self.ClassName + ' > ' + WhichFailedToLoad); LSSL := TIdSSLIOHandlerSocketOpenSSL.Create(LHTTP); LSSL.SSLOptions.Method := sslvTLSv1_2; @@ -407,9 +408,6 @@ procedure TProviderRESTIndy.HTTP(const AMethod: TRESTMethod; const AItemREST: TL finally LHTTP.Free; - if Assigned(LSSL) then - UnLoadOpenSSLLibrary; - if Assigned(AItemREST.Stream) then AItemREST.Stream.Free; diff --git a/src/Providers/DataLogger.Provider.REST.NetHTTPClient.pas b/src/Providers/DataLogger.Provider.REST.NetHTTPClient.pas index 2005b9c..087bc6b 100644 --- a/src/Providers/DataLogger.Provider.REST.NetHTTPClient.pas +++ b/src/Providers/DataLogger.Provider.REST.NetHTTPClient.pas @@ -321,11 +321,11 @@ procedure TProviderRESTNetHTTPClient.HTTP(const AMethod: TRESTMethod; const AIte LHTTP.SendTimeout := 60000; {$ENDIF} LHTTP.HandleRedirects := True; - LHTTP.AcceptCharSet := 'utf-8'; - LHTTP.AcceptEncoding := 'utf-8'; LHTTP.UserAgent := 'DataLogger.Provider.REST.NetHTTPClient'; LHTTP.ContentType := FContentType; - LHTTP.Accept := FContentType; + LHTTP.AcceptCharSet := 'utf-8'; + LHTTP.AcceptEncoding := 'gzip, deflate, br'; + LHTTP.Accept := '*/*'; if not FToken.Trim.IsEmpty then LHTTP.CustomHeaders['Authorization'] := FToken;