Skip to content

Commit

Permalink
Fixes #546:
Browse files Browse the repository at this point in the history
- Removing TIdMappedPortTCP.ContextCreated(), as it doesn't do anything that TIdTCPServer isn't already doing.
- Updating TIdFTPServer.ContextCreated() to fire the OnContextCreated event.
  • Loading branch information
rlebeau committed Oct 11, 2024
1 parent 8f3f31f commit 8cb7bc4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
2 changes: 1 addition & 1 deletion Lib/Protocols/IdFTPServer.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2472,7 +2472,6 @@ procedure TIdFTPServer.ContextCreated(AContext: TIdContext);
LContext : TIdFTPServerContext;
begin
LContext := (AContext as TIdFTPServerContext);
LContext.Server := Self;
//from Before run method
LContext.FDataPort := 0;
LContext.FPasswordAttempts := 0;
Expand Down Expand Up @@ -2516,6 +2515,7 @@ procedure TIdFTPServer.ContextCreated(AContext: TIdContext);
if FDirFormat = ftpdfDOS then begin
LContext.FMSDOSMode := True;
end;
inherited ContextCreated(AContext);
end;

destructor TIdFTPServer.Destroy;
Expand Down
6 changes: 0 additions & 6 deletions Lib/Protocols/IdMappedPortTCP.pas
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ TIdMappedPortTCP = class(TIdCustomTCPServer)
FOnOutboundData: TIdServerThreadEvent;
FOnOutboundDisConnect: TIdServerThreadEvent;
//
procedure ContextCreated(AContext:TIdContext); override;
procedure DoBeforeConnect(AContext: TIdContext); virtual;
procedure DoConnect(AContext: TIdContext); override;
function DoExecute(AContext: TIdContext): boolean; override;
Expand Down Expand Up @@ -211,11 +210,6 @@ procedure TIdMappedPortTCP.InitComponent;
FContextClass := TIdMappedPortContext;
end;

procedure TIdMappedPortTCP.ContextCreated(AContext: TIdContext);
begin
TIdMappedPortContext(AContext).Server := Self;
end;

procedure TIdMappedPortTCP.DoBeforeConnect(AContext: TIdContext);
begin
if Assigned(FOnBeforeConnect) then begin
Expand Down

0 comments on commit 8cb7bc4

Please sign in to comment.