Skip to content

Commit dc9fdd8

Browse files
committed
Progress day: 20 Sept 2025 - Morning
1 parent f448df0 commit dc9fdd8

25 files changed

Lines changed: 784 additions & 684 deletions

Client/Client.dpr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ uses
6666
Optix.InformationGathering.Helper in '..\Shared\Optix.InformationGathering.Helper.pas',
6767
Optix.Process.Helper in '..\Shared\Optix.Process.Helper.pas',
6868
Optix.Func.SessionInformation in '..\Shared\Functions\Optix.Func.SessionInformation.pas',
69-
Optix.Func.Enum.Process in '..\Shared\Functions\Optix.Func.Enum.Process.pas',
69+
Optix.Process.Enum in '..\Shared\Optix.Process.Enum.pas',
7070
Optix.Protocol.SessionHandler in 'Units\Threads\Optix.Protocol.SessionHandler.pas',
7171
Optix.Protocol.Client in 'Units\Threads\Optix.Protocol.Client.pas',
7272
XSuperJSON in '..\Shared\XSuperJSON.pas',
@@ -75,7 +75,7 @@ uses
7575
Optix.System.Helper in '..\Shared\Optix.System.Helper.pas',
7676
Optix.Shared.Types in '..\Shared\Optix.Shared.Types.pas',
7777
Optix.Func.LogNotifier in '..\Shared\Functions\Optix.Func.LogNotifier.pas',
78-
Optix.Func.Enum.FileSystem in '..\Shared\Functions\Optix.Func.Enum.FileSystem.pas',
78+
Optix.FileSystem.Enum in '..\Shared\Optix.FileSystem.Enum.pas',
7979
Optix.Shared.Classes in '..\Shared\Optix.Shared.Classes.pas',
8080
Optix.FileSystem.Helper in '..\Shared\Optix.FileSystem.Helper.pas',
8181
Optix.Protocol.Preflight in '..\Shared\Optix.Protocol.Preflight.pas',
@@ -89,7 +89,8 @@ uses
8989
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
9090
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
9191
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
92-
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
92+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas',
93+
Optix.Func.Commands.Shell in '..\Shared\Functions\Optix.Func.Commands.Shell.pas';
9394

9495
begin
9596
IsMultiThread := True;

Client/Client.dproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
<DCCReference Include="..\Shared\Optix.InformationGathering.Helper.pas"/>
130130
<DCCReference Include="..\Shared\Optix.Process.Helper.pas"/>
131131
<DCCReference Include="..\Shared\Functions\Optix.Func.SessionInformation.pas"/>
132-
<DCCReference Include="..\Shared\Functions\Optix.Func.Enum.Process.pas"/>
132+
<DCCReference Include="..\Shared\Optix.Process.Enum.pas"/>
133133
<DCCReference Include="Units\Threads\Optix.Protocol.SessionHandler.pas"/>
134134
<DCCReference Include="Units\Threads\Optix.Protocol.Client.pas"/>
135135
<DCCReference Include="..\Shared\XSuperJSON.pas"/>
@@ -138,7 +138,7 @@
138138
<DCCReference Include="..\Shared\Optix.System.Helper.pas"/>
139139
<DCCReference Include="..\Shared\Optix.Shared.Types.pas"/>
140140
<DCCReference Include="..\Shared\Functions\Optix.Func.LogNotifier.pas"/>
141-
<DCCReference Include="..\Shared\Functions\Optix.Func.Enum.FileSystem.pas"/>
141+
<DCCReference Include="..\Shared\Optix.FileSystem.Enum.pas"/>
142142
<DCCReference Include="..\Shared\Optix.Shared.Classes.pas"/>
143143
<DCCReference Include="..\Shared\Optix.FileSystem.Helper.pas"/>
144144
<DCCReference Include="..\Shared\Optix.Protocol.Preflight.pas"/>
@@ -153,6 +153,7 @@
153153
<DCCReference Include="..\Shared\Optix.ClassesRegistry.pas"/>
154154
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.FileSystem.pas"/>
155155
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Process.pas"/>
156+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Shell.pas"/>
156157
<BuildConfiguration Include="Base">
157158
<Key>Base</Key>
158159
</BuildConfiguration>

Client/Client_OpenSSL.dpr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ uses
7272
Optix.InformationGathering.Helper in '..\Shared\Optix.InformationGathering.Helper.pas',
7373
Optix.Process.Helper in '..\Shared\Optix.Process.Helper.pas',
7474
Optix.Func.SessionInformation in '..\Shared\Functions\Optix.Func.SessionInformation.pas',
75-
Optix.Func.Enum.Process in '..\Shared\Functions\Optix.Func.Enum.Process.pas',
75+
Optix.Process.Enum in '..\Shared\Optix.Process.Enum.pas',
7676
Optix.Protocol.SessionHandler in 'Units\Threads\Optix.Protocol.SessionHandler.pas',
7777
Optix.Protocol.Client in 'Units\Threads\Optix.Protocol.Client.pas',
7878
XSuperJSON in '..\Shared\XSuperJSON.pas',
@@ -81,7 +81,7 @@ uses
8181
Optix.System.Helper in '..\Shared\Optix.System.Helper.pas',
8282
Optix.Shared.Types in '..\Shared\Optix.Shared.Types.pas',
8383
Optix.Func.LogNotifier in '..\Shared\Functions\Optix.Func.LogNotifier.pas',
84-
Optix.Func.Enum.FileSystem in '..\Shared\Functions\Optix.Func.Enum.FileSystem.pas',
84+
Optix.FileSystem.Enum in '..\Shared\Optix.FileSystem.Enum.pas',
8585
Optix.Shared.Classes in '..\Shared\Optix.Shared.Classes.pas',
8686
Optix.FileSystem.Helper in '..\Shared\Optix.FileSystem.Helper.pas',
8787
Optix.Protocol.Preflight in '..\Shared\Optix.Protocol.Preflight.pas',
@@ -95,7 +95,8 @@ uses
9595
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
9696
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
9797
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
98-
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
98+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas',
99+
Optix.Func.Commands.Shell in '..\Shared\Functions\Optix.Func.Commands.Shell.pas';
99100

100101
begin
101102
IsMultiThread := True;

Client/Client_OpenSSL.dproj

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<DCCReference Include="..\Shared\Optix.InformationGathering.Helper.pas"/>
154154
<DCCReference Include="..\Shared\Optix.Process.Helper.pas"/>
155155
<DCCReference Include="..\Shared\Functions\Optix.Func.SessionInformation.pas"/>
156-
<DCCReference Include="..\Shared\Functions\Optix.Func.Enum.Process.pas"/>
156+
<DCCReference Include="..\Shared\Optix.Process.Enum.pas"/>
157157
<DCCReference Include="Units\Threads\Optix.Protocol.SessionHandler.pas"/>
158158
<DCCReference Include="Units\Threads\Optix.Protocol.Client.pas"/>
159159
<DCCReference Include="..\Shared\XSuperJSON.pas"/>
@@ -162,7 +162,7 @@
162162
<DCCReference Include="..\Shared\Optix.System.Helper.pas"/>
163163
<DCCReference Include="..\Shared\Optix.Shared.Types.pas"/>
164164
<DCCReference Include="..\Shared\Functions\Optix.Func.LogNotifier.pas"/>
165-
<DCCReference Include="..\Shared\Functions\Optix.Func.Enum.FileSystem.pas"/>
165+
<DCCReference Include="..\Shared\Optix.FileSystem.Enum.pas"/>
166166
<DCCReference Include="..\Shared\Optix.Shared.Classes.pas"/>
167167
<DCCReference Include="..\Shared\Optix.FileSystem.Helper.pas"/>
168168
<DCCReference Include="..\Shared\Optix.Protocol.Preflight.pas"/>
@@ -177,6 +177,7 @@
177177
<DCCReference Include="..\Shared\Optix.ClassesRegistry.pas"/>
178178
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.FileSystem.pas"/>
179179
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Process.pas"/>
180+
<DCCReference Include="..\Shared\Functions\Optix.Func.Commands.Shell.pas"/>
180181
<BuildConfiguration Include="Base">
181182
<Key>Base</Key>
182183
</BuildConfiguration>
@@ -224,6 +225,18 @@
224225
<Overwrite>true</Overwrite>
225226
</Platform>
226227
</DeployFile>
228+
<DeployFile LocalName="bins\OpenSSL\Win64\Debug\Client_OpenSSL.exe" Configuration="Debug" Class="ProjectOutput">
229+
<Platform Name="Win64">
230+
<RemoteName>Client_OpenSSL.exe</RemoteName>
231+
<Overwrite>true</Overwrite>
232+
</Platform>
233+
</DeployFile>
234+
<DeployFile LocalName="bins\OpenSSL\Win64\Debug\Client_OpenSSL.rsm" Configuration="Debug" Class="DebugSymbols">
235+
<Platform Name="Win64">
236+
<RemoteName>Client_OpenSSL.rsm</RemoteName>
237+
<Overwrite>true</Overwrite>
238+
</Platform>
239+
</DeployFile>
227240
<DeployClass Name="AdditionalDebugSymbols">
228241
<Platform Name="iOSSimulator">
229242
<Operation>1</Operation>

Client/Units/Threads/Optix.Protocol.SessionHandler.pas

Lines changed: 46 additions & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ interface
5454
XSuperObject,
5555

5656
Optix.Protocol.Client.Handler, Optix.Protocol.Packet, Optix.Protocol.Preflight, Optix.Protocol.Worker.FileTransfer,
57-
Optix.Func.Commands, Optix.Func.Commands.Base, Optix.Actions.ProcessHandler;
57+
Optix.Func.Commands, Optix.Func.Commands.Base, Optix.Actions.ProcessHandler, Optix.Func.Commands.FileSystem,
58+
Optix.Func.Commands.Shell;
5859
// ---------------------------------------------------------------------------------------------------------------------
5960

6061
type
@@ -125,8 +126,7 @@ implementation
125126

126127
Winapi.Windows,
127128

128-
Optix.Func.SessionInformation, Optix.Func.Enum.Process, Optix.Func.LogNotifier, Optix.Func.Enum.FileSystem,
129-
Optix.Thread, Optix.Task.ProcessDump, Optix.Func.Shell, Optix.ClassesRegistry;
129+
Optix.Func.SessionInformation, Optix.Func.LogNotifier, Optix.Thread, Optix.Func.Shell, Optix.ClassesRegistry;
130130
// ---------------------------------------------------------------------------------------------------------------------
131131

132132
{ TOptixSessionHandlerThread.Initialize }
@@ -400,119 +400,56 @@ procedure TOptixSessionHandlerThread.PacketReceived(const ASerializedPacket : IS
400400
if ASerializedPacket.Contains('WindowGUID') then
401401
AWindowGUID := TGUID.Create(ASerializedPacket.S['WindowGUID']);
402402

403-
var AOptixPacket : TOptixPacket := nil;
404-
var AHandleMemory : Boolean := False; // TODO: Remove that when migration (Generic) finished
403+
var AOptixPacket : TOptixPacket := nil;
404+
var AHandleMemory : Boolean := True;
405405
try
406406
try
407-
AOptixPacket := TOptixPacket(TClassesRegistry.CreateInstance(AClassName, [TValue.From<ISuperObject>(ASerializedPacket)]));
408-
if Assigned(AOptixPacket) then begin
409-
// Optix Action Command (& Response)
410-
if AOptixPacket is TOptixCommandAction then begin
411-
TOptixCommandActionResponse(AOptixPacket).DoAction();
412-
413-
// For Action & Response
414-
if AOptixPacket is TOptixCommandActionResponse then begin
415-
AHandleMemory := True;
416-
417-
///
418-
AddPacket(AOptixPacket);
419-
end;
420-
// Optix Task Command
421-
end else if AOptixPacket is TOptixCommandTask then begin
422-
AHandleMemory := True;
423-
424-
var ATask := TOptixCommandTask(AOptixPacket).CreateTask(TOptixCommand(AOptixPacket));
425-
426-
RegisterAndStartNewTask(ATask);
427-
end;
428-
end;
429-
430-
Continuer l'implémentation "générique", y compris à l'intérieur des tasks, afin de rendre l'ensemble le plus
431-
générique possible, y compris coté serveur + l'implémenter sur le client GUI.
432-
433-
// ---------------------------------------------------------------------------------------------------------------
434-
if AClassName = TOptixCommandTerminate.ClassName then
435-
Terminate
436-
// ---------------------------------------------------------------------------------------------------------------
437-
else if AClassName = TOptixCommandRefreshProcess.ClassName then
438-
AddPacket(TProcessList.Create(AWindowGUID))
439-
// ---------------------------------------------------------------------------------------------------------------
440-
else if AClassName = TOptixCommandRefreshDrives.ClassName then
441-
AddPacket(TDriveList.Create(AWindowGUID))
442-
// ---------------------------------------------------------------------------------------------------------------
443-
else if AClassName = TOptixCommandRefreshFiles.ClassName then begin
444-
AOptixPacket := TOptixCommandRefreshFiles.Create(ASerializedPacket);
445-
446-
AddPacket(TFileList.Create(AWindowGUID, TOptixCommandRefreshFiles(AOptixPacket).Path));
447-
end
448-
// ---------------------------------------------------------------------------------------------------------------
449-
else if AClassName = TOptixCommandDownloadFile.ClassName then
450-
RegisterNewFileTransfer(TOptixCommandDownloadFile.Create(ASerializedPacket))
451-
// ---------------------------------------------------------------------------------------------------------------
452-
else if AClassName = TOptixCommandUploadFile.ClassName then
453-
RegisterNewFileTransfer(TOptixCommandUploadFile.Create(ASerializedPacket))
454-
// ---------------------------------------------------------------------------------------------------------------
455-
else if AClassName = TOptixStartShellInstance.ClassName then begin
456-
AOptixPacket := TOptixStartShellInstance.Create(ASerializedPacket);
457-
458-
RegisterAndStartNewShellInstance(TOptixStartShellInstance(AOptixPacket));
459-
end
460-
// ---------------------------------------------------------------------------------------------------------------
461-
else if AClassName = TOptixTerminateShellInstance.ClassName then begin
462-
AOptixPacket := TOptixTerminateShellInstance.Create(ASerializedPacket);
463-
464-
TerminateShellInstance(TOptixTerminateShellInstance(AOptixPacket));
465-
end
466-
// ---------------------------------------------------------------------------------------------------------------
467-
else if AClassName = TOptixBreakShellInstance.ClassName then begin
468-
AOptixPacket := TOptixBreakShellInstance.Create(ASerializedPacket);
469-
470-
BreakShellInstance(TOptixBreakShellInstance(AOptixPacket));
471-
end
472-
// ---------------------------------------------------------------------------------------------------------------
473-
else if AClassName = TOptixStdinShellInstance.ClassName then begin
474-
AOptixPacket := TOptixStdinShellInstance.Create(ASerializedPacket);
475-
476-
StdinToShellInstance(TOptixStdinShellInstance(AOptixPacket));
477-
end
478-
// ---------------------------------------------------------------------------------------------------------------
479-
480-
// ---------------------------------------------------------------------------------------------------------------
481-
482-
// ---------------------------------------------------------------------------------------------------------------
483-
484-
// ---------------------------------------------------------------------------------------------------------------
485-
486-
// ---------------------------------------------------------------------------------------------------------------
487-
488-
// ---------------------------------------------------------------------------------------------------------------
489-
490-
// ---------------------------------------------------------------------------------------------------------------
491-
492-
// ---------------------------------------------------------------------------------------------------------------
493-
494-
// ---------------------------------------------------------------------------------------------------------------
495-
496-
// ---------------------------------------------------------------------------------------------------------------
497-
498-
// ---------------------------------------------------------------------------------------------------------------
499-
500-
// ---------------------------------------------------------------------------------------------------------------
501-
502-
// ---------------------------------------------------------------------------------------------------------------
503-
504-
// ---------------------------------------------------------------------------------------------------------------
407+
AOptixPacket := TOptixPacket(TClassesRegistry.CreateInstance(AClassName, [
408+
TValue.From<ISuperObject>(ASerializedPacket)
409+
]));
410+
if not Assigned(AOptixPacket) then
411+
Exit();
412+
///
505413

506-
// ---------------------------------------------------------------------------------------------------------------
414+
// Optix Action Command (& Response)
415+
if AOptixPacket is TOptixCommandAction then begin
416+
TOptixCommandActionResponse(AOptixPacket).DoAction();
507417

508-
// ---------------------------------------------------------------------------------------------------------------
418+
// For Action & Response
419+
if AOptixPacket is TOptixCommandActionResponse then begin
509420

510-
// ---------------------------------------------------------------------------------------------------------------
421+
///
422+
AddPacket(AOptixPacket);
423+
end;
424+
// Optix Task Command
425+
end else if AOptixPacket is TOptixCommandTask then begin
426+
var ATask := TOptixCommandTask(AOptixPacket).CreateTask(TOptixCommand(AOptixPacket));
511427

512-
// ---------------------------------------------------------------------------------------------------------------
428+
///
429+
RegisterAndStartNewTask(ATask);
430+
// Optix Transfers (Download & Upload)
431+
end else if AOptixPacket is TOptixCommandTransfer then
432+
RegisterNewFileTransfer(TOptixCommandTransfer(AOptixPacket))
433+
// Shell Coammdns
434+
else if AOptixPacket is TOptixCommandShell then begin
435+
if AOptixPacket is TOptixStartShellInstance then
436+
RegisterAndStartNewShellInstance(TOptixStartShellInstance(AOptixPacket))
437+
else if AOptixPacket is TOptixTerminateShellInstance then
438+
TerminateShellInstance(TOptixTerminateShellInstance(AOptixPacket))
439+
else if AOptixPacket is TOptixBreakShellInstance then
440+
BreakShellInstance(TOptixBreakShellInstance(AOptixPacket))
441+
else if AOptixPacket is TOptixStdinShellInstance then
442+
StdinToShellInstance(TOptixStdinShellInstance(AOptixPacket));
443+
// Simple Commands
444+
end else if AOptixPacket is TOptixSimpleCommand then begin
445+
AHandleMemory := False;
446+
///
513447

514-
// ---------------------------------------------------------------------------------------------------------------
515-
// ... //
448+
// -------------------------------------------------------------------------------------------------------------
449+
if AOptixPacket is TOptixCommandTerminate then
450+
Terminate;
451+
// -------------------------------------------------------------------------------------------------------------
452+
end;
516453
except
517454
on E : Exception do
518455
AddPacket(TLogNotifier.Create(E.Message, AClassName, lkException));

Client/Units/Threads/Optix.Protocol.Worker.FileTransfer.pas

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ interface
5151

5252
Generics.Collections,
5353

54-
Optix.Protocol.Client, Optix.Protocol.Preflight, Optix.Func.Commands, Optix.Protocol.Client.Handler
54+
Optix.Protocol.Client, Optix.Protocol.Preflight, Optix.Func.Commands, Optix.Protocol.Client.Handler,
55+
Optix.Func.Commands.FileSystem
5556

5657
{$IFDEF USETLS}, Optix.OpenSSL.Helper{$ENDIF};
5758
// ---------------------------------------------------------------------------------------------------------------------

Server/OptixGate.dpr

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ uses
6666
Optix.WinApiEx in '..\Shared\Optix.WinApiEx.pas',
6767
Optix.Process.Helper in '..\Shared\Optix.Process.Helper.pas',
6868
Optix.Func.LogNotifier in '..\Shared\Functions\Optix.Func.LogNotifier.pas',
69-
Optix.Func.Enum.Process in '..\Shared\Functions\Optix.Func.Enum.Process.pas',
69+
Optix.Process.Enum in '..\Shared\Optix.Process.Enum.pas',
7070
Optix.FileSystem.Helper in '..\Shared\Optix.FileSystem.Helper.pas',
71-
Optix.Func.Enum.FileSystem in '..\Shared\Functions\Optix.Func.Enum.FileSystem.pas',
71+
Optix.FileSystem.Enum in '..\Shared\Optix.FileSystem.Enum.pas',
7272
Optix.Shared.Classes in '..\Shared\Optix.Shared.Classes.pas',
7373
Optix.Protocol.Preflight in '..\Shared\Optix.Protocol.Preflight.pas',
7474
Optix.Protocol.Exceptions in '..\Shared\Optix.Protocol.Exceptions.pas',
@@ -102,7 +102,8 @@ uses
102102
Optix.Func.Commands.Base in '..\Shared\Functions\Optix.Func.Commands.Base.pas',
103103
Optix.ClassesRegistry in '..\Shared\Optix.ClassesRegistry.pas',
104104
Optix.Func.Commands.FileSystem in '..\Shared\Functions\Optix.Func.Commands.FileSystem.pas',
105-
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas';
105+
Optix.Func.Commands.Process in '..\Shared\Functions\Optix.Func.Commands.Process.pas',
106+
Optix.Func.Commands.Shell in '..\Shared\Functions\Optix.Func.Commands.Shell.pas';
106107

107108
{$R *.res}
108109
{$R data.res}

0 commit comments

Comments
 (0)