Skip to content

Commit

Permalink
correções e melhorias
Browse files Browse the repository at this point in the history
- Correção para uso de Rotas com e sem autorização.
- Correção da WriteToDataset para FireDAC e outros.
- Correção na JSON Interface para accessviolation parar em arrays e outros valores null.
- Correção de MemoryLeak (TRESTDWMessageDecoderMIME)
- Correção de MemoryLeak quando autenticação Bearer/Token (TRESTDWJSONInterfaceObject)
- Remoção de memleaks nas classes JSON internas do RESTDataware.
- Remoção de memleaks no WriteToDataset.
- Ajuste de Compilação Lazarus e Delphi's antigos dos novos fixes.
- Correção Memory Leaks uRESTDWJSONInterface (TJSONArray)
- Fix do Indice de Strings para FMX Linux/Android.
- Correções do Método Put para novas integrações.
- Correções para campos ORABlob no ClientSQL e dwMemtable.
- Correção para compilação delphi Linux,
- correção para deamons applications Linux
- Novo Sistema de OffSets de Word para Integer.
- MemoryLeak na getpai
- Remoção de limites de campos para o RESTDW.
- Realizada transferência de arquivos com mais de 1gb
- Fix de memleak para o ClientREST com uso de SSL.
- Fix na ServerMethodClass e no DM de RESTDW para quando os parametros vem por get do clientpooler.
- Correção dos bytes para Linux Delphi
- add StreamToString(ms) em lugares que ainda estavam tstringstream(ms).datastring dentro do parser de body novo
- Correcoes de AV
- Correção para Geracao e acesso a dados date/time e datetime
- Correção no codigo do readrawheaders
- Correções diversas para o Server Linux Delphi.
- Finalização do sistema de buffers binarios em Delphi Linux e outros, SuperServer Finalizado.
  • Loading branch information
ronierys2@hotmail.com committed Mar 29, 2024
1 parent a010700 commit 8a8bee8
Show file tree
Hide file tree
Showing 30 changed files with 1,387 additions and 1,218 deletions.
10 changes: 10 additions & 0 deletions CORE/Packages/Delphi/Connectors/Indy/RESTDWSocketIndy.dof
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,13 @@ OriginalFilename=
ProductName=RESTDWSocketIndy
ProductVersion=1.0.0.0
ProgramID=com.embarcadero.RESTDWSocketIndy
[HistoryLists\hlConditionals]
Count=1
Item0=DEBUG
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlUnitOutputDirectory]
Count=2
Item0=..\..\..\..\compiled
Item1=..\..\..\compiled
8 changes: 7 additions & 1 deletion CORE/Packages/Delphi/Connectors/Indy/RESTDWSocketIndy.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@
</DelphiCompile>
<DCCReference Include="RESTDWCore.dcp"/>
<DCCReference Include="IndySystem.dcp"/>
<DCCReference Include="IndyProtocols.dcp"/>
<DCCReference Include="IndyCore.dcp"/>
<DCCReference Include="IndyProtocols.dcp"/>
<DCCReference Include="..\..\..\..\Source\Sockets\Indy\uRESTDWIdBase.pas"/>
<BuildConfiguration Include="Base">
<Key>Base</Key>
Expand Down Expand Up @@ -221,6 +221,12 @@
<DeployFile LocalName="..\..\..\..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\22.0\Bpl\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="..\..\..\..\..\..\..\..\..\..\Public\Documents\Embarcadero\Studio\22.0\Bpl\Win64\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\20.0\Bpl\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput"/>
<DeployFile LocalName="C:\Users\Public\Documents\Embarcadero\Studio\22.0\Bpl\RESTDWSocketIndy.bpl" Configuration="Debug" Class="ProjectOutput">
<Platform Name="Win32">
<RemoteName>RESTDWSocketIndy.bpl</RemoteName>
<Overwrite>true</Overwrite>
</Platform>
</DeployFile>
<DeployClass Name="AdditionalDebugSymbols">
<Platform Name="OSX32">
<Operation>1</Operation>
Expand Down
4 changes: 2 additions & 2 deletions CORE/Packages/Delphi/RESTDWCore.dproj
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,12 @@
<PropertyGroup Condition="'$(Cfg_2_Win32)'!=''">
<DCC_DcuOutput>..\..\compiled</DCC_DcuOutput>
<VerInfo_IncludeVerInfo>true</VerInfo_IncludeVerInfo>
<VerInfo_Keys>CompanyName=XyberPower Desenvolvimento;FileDescription=$(MSBuildProjectName);FileVersion=2.1.0.98;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Keys>CompanyName=XyberPower Desenvolvimento;FileDescription=$(MSBuildProjectName);FileVersion=2.1.0.101;InternalName=;LegalCopyright=;LegalTrademarks=;OriginalFilename=;ProductName=$(MSBuildProjectName);ProductVersion=1.0.0.0;Comments=;ProgramID=com.embarcadero.$(MSBuildProjectName)</VerInfo_Keys>
<VerInfo_Locale>1033</VerInfo_Locale>
<VerInfo_MajorVer>2</VerInfo_MajorVer>
<VerInfo_MinorVer>1</VerInfo_MinorVer>
<DCC_Description>REST Dataware - Core</DCC_Description>
<VerInfo_Build>98</VerInfo_Build>
<VerInfo_Build>101</VerInfo_Build>
<VerInfo_AutoIncVersion>true</VerInfo_AutoIncVersion>
<DCC_DebugInfoInExe>true</DCC_DebugInfoInExe>
</PropertyGroup>
Expand Down
9 changes: 0 additions & 9 deletions CORE/Packages/Delphi/ShellTools/RESTDWShellServicesDesign.dof
Original file line number Diff line number Diff line change
Expand Up @@ -134,12 +134,3 @@ OriginalFilename=
ProductName=RESTDWShellServicesDesign
ProductVersion=1.0.0.0
ProgramID=com.embarcadero.RESTDWShellServicesDesign
[HistoryLists\hlConditionals]
Count=1
Item0=DEBUG
[HistoryLists\hlUnitAliases]
Count=1
Item0=WinTypes=Windows;WinProcs=Windows;DbiTypes=BDE;DbiProcs=BDE;DbiErrs=BDE;
[HistoryLists\hlUnitOutputDirectory]
Count=1
Item0=..\..\..\compiled
21 changes: 21 additions & 0 deletions CORE/Source/Basic/Mechanics/uRESTDWBuffer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@
AByteCount : Integer = -1;
AAppend : Boolean = True;
AIndex : Integer = -1);
Procedure ExtractToBytesB (Var VBytes : TRESTDWBytes;
AByteCount : Integer);
Function IndexOf (Const AByte : Byte;
AStartPos : Integer = 0) : Integer; Overload;
Function IndexOf (Const ABytes : TRESTDWBytes;
Expand Down Expand Up @@ -212,6 +214,25 @@ implementation
End;
End;

Procedure TRESTDWBuffer.ExtractToBytesB(Var VBytes : TRESTDWBytes;
AByteCount : Integer);
Var
LOldPosition,
LOldSize : Integer;
Begin
If AByteCount < 0 Then
AByteCount := Size;
If AByteCount > 0 Then
Begin
LOldSize := 0;
If Length(FBytes) > 0 Then
Begin
SetLength(VBytes, Length(FBytes));
Move(FBytes[0], VBytes[0], Length(FBytes));
End;
End;
End;

Procedure TRESTDWBuffer.ExtractToBuffer(ABuffer : TRESTDWBuffer;
AByteCount : Integer = -1;
Const AIndex : Integer = -1);
Expand Down
12 changes: 6 additions & 6 deletions CORE/Source/Basic/Mechanics/uRESTDWCoder.pas
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ interface
Procedure Decode(Const AIn : String); Overload;
Procedure Decode(ASrcStream : TStream;
Const ABytes : Integer = -1); Overload; Virtual; Abstract;
Class Function DecodeString (Const AIn : String) : String;
Class Function DecodeBytes (Const AIn : String) : TRESTDWBytes;
Class procedure DecodeStream(Const AIn : String;
Class Function DecodeString (Const AIn : AnsiString) : String;
Class Function DecodeBytes (Const AIn : AnsiString) : TRESTDWBytes;
Class procedure DecodeStream(Const AIn : AnsiString;
ADestStream : TStream);
End;
TRESTDWDecoderClass = Class Of TRESTDWDecoder;
Expand Down Expand Up @@ -114,7 +114,7 @@ interface
End;
End;

Class Function TRESTDWDecoder.DecodeString(Const AIn : String) : String;
Class Function TRESTDWDecoder.DecodeString(Const AIn : AnsiString) : String;
Var
LStream : TMemoryStream;
Begin
Expand All @@ -128,7 +128,7 @@ interface
End;
End;

Class Function TRESTDWDecoder.DecodeBytes(const AIn : String) : TRESTDWBytes;
Class Function TRESTDWDecoder.DecodeBytes(const AIn : AnsiString) : TRESTDWBytes;
Var
LStream : TMemoryStream;
Begin
Expand All @@ -143,7 +143,7 @@ interface
End;
End;

Class Procedure TRESTDWDecoder.DecodeStream(Const AIn : String;
Class Procedure TRESTDWDecoder.DecodeStream(Const AIn : AnsiString;
ADestStream : TStream);
Var
LDecoder : TRESTDWDecoder;
Expand Down
52 changes: 34 additions & 18 deletions CORE/Source/Basic/Mechanics/uRESTDWDataUtils.pas
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface
VersionNumber,
RecordCount,
ParamsCount : DWInteger; //new for ver15
DataSize : DWInt64; //new for ver15
DataSize : DWInt64; //new for ver15
End;

TTokenValue = Class
Expand Down Expand Up @@ -1991,14 +1991,11 @@ implementation
Cmd := Cmd + URLDecode(Params.Text)
Else
Cmd := URLDecode(Query);
// Uri := TIdURI.Create(Cmd);
Try
// vParams.Delimiter := '|';
vParams.Text := StringReplace(Cmd, '&', sLineBreak, [rfReplaceAll]);
If vParams.count = 0 Then
If Trim(Cmd) <> '' Then
vParams.DelimitedText := StringReplace(Cmd, sLineBreak, '&', [rfReplaceAll]); //Alterações enviadas por "joaoantonio19"
//vParams.Add(Cmd);
Finally
encodestrings := False;
For I := 0 To vParams.Count - 1 Do
Expand All @@ -2024,28 +2021,37 @@ implementation
If (vParams.names[I] <> '') And
(Trim(Query) <> '') Then
Begin
JSONParam.ParamName := Trim(Copy(vParams[I], 1, Pos('=', vParams[I]) - 1));
JSONParam.AsString := Trim(Copy(vParams[I], Pos('=', vParams[I]) + 1, Length(vParams[I])));
JSONParam.ParamName := vParamName;
vValue := Trim(Copy(vParams[I], Pos('=', vParams[I]) + 1, Length(vParams[I])));
If pos('dwencodestrings', lowercase(JSONParam.ParamName)) > 0 Then
encodestrings := StringToBoolean(JSONParam.AsString)
encodestrings := StringToBoolean(vValue)
Else If (encodestrings) And
(pos('dwwelcomemessage', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwaccesstag', lowercase(JSONParam.ParamName)) = 0) And
(pos('datacompression', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwencodestrings', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwusecript', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwassyncexec', lowercase(JSONParam.ParamName)) = 0) And
(pos('binaryrequest', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwaccesstag', lowercase(JSONParam.ParamName)) = 0) And
(pos('datacompression', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwencodestrings', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwusecript', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwassyncexec', lowercase(JSONParam.ParamName)) = 0) And
(pos('binaryrequest', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwconnectiondefs', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwservereventname', lowercase(JSONParam.ParamName)) = 0) Then
JSONParam.AsString := DecodeStrings(JSONParam.AsString{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
Begin
JSONParam.Encoded := False;
If MethodType = rtPost Then
JSONParam.AsString := DecodeStrings(DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
Else
JSONParam.AsString := DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
End;
If JSONParam.IsNull Then
JSONParam.AsString := vValue;
End
Else
Begin
JSONParam.ParamName := IntToStr(I);
JSONParam.AsString := vParams[I];
JSONParam.ParamName := IntToStr(I);
vValue := vParams[I];
If pos('dwencodestrings', lowercase(JSONParam.ParamName)) > 0 Then
encodestrings := StringToBoolean(JSONParam.AsString)
encodestrings := StringToBoolean(vValue)
Else If (encodestrings) And
(pos('dwwelcomemessage', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwaccesstag', lowercase(JSONParam.ParamName)) = 0) And
Expand All @@ -2056,7 +2062,16 @@ implementation
(pos('binaryrequest', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwconnectiondefs', lowercase(JSONParam.ParamName)) = 0) And
(pos('dwservereventname', lowercase(JSONParam.ParamName)) = 0) Then
JSONParam.AsString := DecodeStrings(JSONParam.AsString{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
Begin
JSONParam.Encoded := False;
If MethodType = rtPost Then
JSONParam.AsString := DecodeStrings(DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF})
Else
JSONParam.AsString := DecodeStrings(vValue{$IFDEF RESTDWLAZARUS}, csUndefined{$ENDIF});
End;
If JSONParam.IsNull Then
JSONParam.AsString := vValue;
End;
{$IFDEF RESTDWLAZARUS}
JSONParam.DatabaseCharSet := DatabaseCharSet;
Expand Down Expand Up @@ -2438,3 +2453,4 @@ implementation

end.


Loading

0 comments on commit 8a8bee8

Please sign in to comment.