Skip to content

Commit

Permalink
correção
Browse files Browse the repository at this point in the history
- Ajuste para funcionamento de IndexFieldNames Delphi velho a Novo e Lazarus(vlw Rodrigo Guelf) pela força noix sempre.
- Correção do ClientConnectionDefs.
  • Loading branch information
ronierys2@hotmail.com committed Mar 19, 2024
1 parent ab13cb5 commit 02ec42c
Show file tree
Hide file tree
Showing 6 changed files with 541 additions and 148 deletions.
22 changes: 10 additions & 12 deletions CORE/Source/Basic/uRESTDWBasic.pas
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ TRESTDWServerIpVersionConfig = class(TPersistent)
baseEventUnit,
vUrlToExec,
aurlContext : String;
Var vRequestHeader : TStringList);
Var vRequestHeader : TStringList;
Var vdwConnectionDefs : TConnectionDefs);
Function ReturnRoute (ServerMethodsClass : TComponent;
Pooler,
urlContext : String;
Expand Down Expand Up @@ -2153,7 +2154,8 @@ procedure TRESTClientPoolerBase.SetIpVersion(IpV: TRESTDWClientIpVersions);
RequestType, vWelcomeMessage, vAccessTag,
vdwCriptKey, compresseddata, encodestrings,
dwassyncexec, vdwservereventname, baseEventUnit,
vUrlToExec, aurlContext, vRequestHeader);
vUrlToExec, aurlContext, vRequestHeader,
vdwConnectionDefs);
End;
WelcomeAccept := True;
tmp := '';
Expand Down Expand Up @@ -3636,7 +3638,8 @@ procedure TRESTClientPoolerBase.SetIpVersion(IpV: TRESTDWClientIpVersions);
RequestType, vWelcomeMessage, vAccessTag,
vdwCriptKey, compresseddata, encodestrings,
dwassyncexec, vdwservereventname, baseEventUnit,
vUrlToExec, aurlContext, vRequestHeader);
vUrlToExec, aurlContext, vRequestHeader,
vdwConnectionDefs);
End;
WelcomeAccept := True;
tmp := '';
Expand Down Expand Up @@ -4697,7 +4700,6 @@ procedure TRESTDWBasicReceptor.SetAuthenticator(
Begin
// lazarus iniciando com sujeira de memoria vStrings
vStrings := nil;

If ServerMethodsClass <> Nil Then
Begin
For I := 0 To ServerMethodsClass.ComponentCount -1 Do
Expand Down Expand Up @@ -5973,7 +5975,8 @@ procedure TRESTDWBasicReceptor.SetAuthenticator(
baseEventUnit,
vUrlToExec,
aurlContext : String;
Var vRequestHeader : TStringList);
Var vRequestHeader : TStringList;
Var vdwConnectionDefs : TConnectionDefs);
Var
I : Integer;
mb : TStringStream;
Expand All @@ -5994,7 +5997,6 @@ procedure TRESTDWBasicReceptor.SetAuthenticator(
decoder : TRESTDWMessageDecoderMIME;
ms : TStream;
vDecoderHeaderList : TStringList;
vdwConnectionDefs : TConnectionDefs;
JSONValue : TRESTDWJSONValue;
Begin
vDecoderHeaderList := Nil;
Expand Down Expand Up @@ -6446,20 +6448,16 @@ procedure TRESTDWBasicReceptor.SetAuthenticator(
vUrlToExec := aurlContext;
End;
Finally
// If Assigned(DWParams) Then
// FreeAndNil(DWParams);
If Assigned(mb) Then
FreeAndNil(mb);
// If Assigned(JSONParam) Then
// FreeAndNil(JSONParam);
If Assigned(newdecoder) Then
FreeAndNil(newdecoder);
If Assigned(decoder) Then
FreeAndNil(decoder);
If Assigned(vDecoderHeaderList) Then
FreeAndNil(vDecoderHeaderList);
If Assigned(vdwConnectionDefs) Then
FreeAndNil(vdwConnectionDefs);
// If Assigned(vdwConnectionDefs) Then
// FreeAndNil(vdwConnectionDefs);
If Assigned(JSONValue) Then
FreeAndNil(JSONValue);
End;
Expand Down
4 changes: 4 additions & 0 deletions CORE/Source/Basic/uRESTDWParams.pas
Original file line number Diff line number Diff line change
Expand Up @@ -4899,6 +4899,10 @@ procedure TRESTDWJSONParam.SetParamContentType(const bValue: String);
vStringStream : TStream;
{$IFDEF RESTDWLAZARUS}
vFileStream : TFileStream;
{$ELSE}
{$IF CompilerVersion < 21}
vFileStream : TFileStream;
{$IFEND}
{$ENDIF}
Begin
vStringStream := Nil;
Expand Down
16 changes: 8 additions & 8 deletions CORE/Source/Basic/uRESTDWPoolermethod.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2491,6 +2491,14 @@ implementation
JSONParam.ObjectDirection := odIn;
JSONParam.AsBoolean := Metadata;
DWParams.Add(JSONParam);
If Assigned(ConnectionDefs) Then
Begin
JSONParam := TRESTDWJSONParam.Create(RESTClientPoolerExec.Encoding);
JSONParam.ParamName := 'dwConnectionDefs';
JSONParam.ObjectDirection := odIn;
JSONParam.AsString := TConnectionDefs(ConnectionDefs).ToJSON;
DWParams.Add(JSONParam);
End;
JSONParam := TRESTDWJSONParam.Create(RESTClientPoolerExec.Encoding);
JSONParam.ParamName := 'Result';
JSONParam.ObjectDirection := odOUT;
Expand All @@ -2507,14 +2515,6 @@ implementation
JSONParam.ObjectDirection := odOUT;
JSONParam.ObjectValue := ovInteger;
DWParams.Add(JSONParam);
If Assigned(ConnectionDefs) Then
Begin
JSONParam := TRESTDWJSONParam.Create(RESTClientPoolerExec.Encoding);
JSONParam.ParamName := 'dwConnectionDefs';
JSONParam.ObjectDirection := odIn;
JSONParam.AsString := TConnectionDefs(ConnectionDefs).ToJSON;
DWParams.Add(JSONParam);
End;
Try
Try
RESTClientPoolerExec.BinaryRequest := vBinaryRequest;
Expand Down
2 changes: 1 addition & 1 deletion CORE/Source/Basic/uRESTDWServerMethodClass.pas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unit uRESTDWServerMethodClass;
unit uRESTDWServerMethodClass;

{$I ..\Includes\uRESTDW.inc}

Expand Down
2 changes: 1 addition & 1 deletion CORE/Source/Plugins/DMDados/uRESTDWDatamodule.pas
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
unit uRESTDWDatamodule;
unit uRESTDWDatamodule;

{$I ..\..\Includes\uRESTDW.inc}

Expand Down
Loading

0 comments on commit 02ec42c

Please sign in to comment.