Indy 9
TIdFTPServerThread
Hierarchy, Properties, Methods, Events, See Also, Unit: IdFTPServer
Implements a thread of execution for client connections to the FTP server.
TIdFTPServerThread = class(TIdPeerThread)
Unit
IdFTPServer
Description
TIdFTPServerThread is a TIdPeerThread descendant that implements the thread of execution created for FTP client on the FTP server. TIdFTPServerThread is used in TIdFTPServer.ThreadClass to indicate the class used to create new thread instances using the TIdThreadMgr for the FTP server implementation.

TIdFTPServerThread provides properties and methods that set or retrieve connection and transfer parameters for the FTP client connection. TIdFTPServerThread implements the inherited Connection property as the Control channel for the FTP client, and also specifies a TIdTCPConnection to be used as the DataChannel for FTP data transfer operations.

TIdFTPServerThread is used to access the Thread of execution in the TIdCommand reply handlers used in the FTP server implementation.


TIdFTPServerThread.ALLOSize
TIdFTPServerThread
Indicates space tpo reserve for new files stored on the FTP server.
property ALLOSize: Integer;
Description
ALLOSize is an Integer property that indicates the optional requested storage space to reserve for new files transferred to the FTP server. ALLOSize is updated in the command reply handler for the FTP ALLO command, and accessed in the command reply handler executed for the FTP STOR or APPE commands.

TIdFTPServerThread.Authenticated
TIdFTPServerThread
Indicates if the FTP client has successfully authenticated the user account for the connection.
property Authenticated: Boolean;
Description
Authenticated is a Boolean property that the client has successfully used the FTP USER and PASS commands to authenticate the user account for the connection. Authenticated is updated in the command reply handler for the FTP PASS command. Authenticated is read prior to executing other FTP command reply handlers, and prevents the handle form executing if the value is False.

TIdFTPServerThread.CurrentDir
TIdFTPServerThread
Indicates the currently selected directory path for the FTP client.
property CurrentDir: string;
Description
CurrentDir is a String property that indicates the currently selected directory path for the FTP client connection. CurrentDir is updated when the command reply handler for the FTP CWD or CDUP command is executed. CurrentDir is read when performing FTP operations that require file or directory handling.

TIdFTPServerThread.DataChannelThread
TIdFTPServerThread
Represents the threaded data channel used for data transmission for an FTP client connection.
property DataChannelThread: TIdDataChannelThread;
Description
DataChannelThread is a TIdDataChannelThread property that represents the threaded data channel used when a threaded FTP client connection needs to read or write data using the FTP STOR, STOU, APPE, RETR, LIST, or NLST command verbs.

DataChannelThread allows the client connection to create and access either an active or a passive connection used for the data channel in the FTP client.

During execution, DataChannelThread uses the Data property to access the TStrings or TStream values used during the data transfer operation. After performing the transfer operation, the socket for the data channel in the thread is disconnected, and the Success or Error message is written using the control channel for the threaded client connection. The data channel thread is stopped after execution of the transfer operation.

DataChannelThread exists for the lifetime of the threaded client connection. It is initalized and started prior to data transfer operations, and suspended when the data transfer operation is completed.


TIdFTPServerThread.DataMode
TIdFTPServerThread
Represents the transmission mode requested for an FTP client connection.
property DataMode: TIdFTPTransferMode;
Description
DataMode is a TIdFTPTransferMode property that represents the transmission mode requested for data transfers on the FTP client connection. DataMode is updated in the command reply handler for the FTP MODE command.

TIdFTPServerThread.DataPort
TIdFTPServerThread
Indicates the port number for the DataChannel in an FTP client connection.
property DataPort: Integer;
Description
DataPort is an Integer property that represents the port number used for the DataChannel for an FTP client connection. The default value for DataPort is 20, as required by the FTP protocol. DataPort can be updated in the command reply handler for the FTP PASV command, when the DataChannel is create and bound for listening for client connections.

TIdFTPServerThread.DataStruct
TIdFTPServerThread
Indicates the data storage representation used for FTP data transfers on the client connection.
property DataStruct: TIdFTPDataStructure;
Description
DataStruct is a TIdFTPDataStructure property that represents the data storage representation used during FTP data transfer. DataStruct is updated when the command reply handler is executed for the FTP STRU command.

TIdFTPServerThread.DataType
TIdFTPServerThread
Represents the file transfer type for the client connection.
property DataType: TIdFTPTransferType;
Description
DataType is a TIdFTPTransferType property that represents the file transfer type requested for sending and receiving data to/from the FTP client connection.

DataType is updated when the command reply handler is executed for the FTP TYPE command.


TIdFTPServerThread.HomeDir
TIdFTPServerThread, See Also
Represents the home directory for the FTP client connection.
property HomeDir: string;
Description
HomeDir is a String property that represents the directory path to use as the parent directory for the user account making the FTP client connection. HomeDir is used in the command reply handler that implement the CDUP command.

TIdFTPServerThread.Password
TIdFTPServerThread, See Also
Represents the account authorization for client connection authentication.
property Password: string;
Description
Password is a String property that represents the account authorization used for authenticating the FTP client connection. Password is read from the client connection and provided to the FTP PASS command reply handler used in the FTP server implementation, or to the OnCommandPASS event handler when UserAccounts are not maintained by the FTP server.

When Username contains the value "anonymous" or "guest", the AccessLevel for the client connection is set to idaAnonymousUser. Otherwise, UserAccounts on the FTP server are used to perform account authorization and determine the AccessLevel for the account.


TIdFTPServerThread.PASV
TIdFTPServerThread, See Also
Inducates if the DataChannel should listen for client connections.
property PASV: Boolean;
Description
PASV is a Boolean property that indicates that the TIdFTPServerThread should listen on a non-standard DataPort for the FTP DataChannel connection. PASV is used in the command reply handler for the FTP PASV command to create and initialize the DataChannel for the Authenticated FTP connection, and starts listening for the Client connection on the DataChannel.

PASV is read in the RETR command reply handler to determine if the DataChannel should Connect (when Passive is False) or Listen for the client connection (when Passive is True) prior to transferring FTP data.


TIdFTPServerThread.RESTPos
TIdFTPServerThread, See Also
Indicates the position of a restart marker in the FTP data stream.
property RESTPos: Integer;
Description
RESTPos is an Integer property that indicates the position of a restart marker in the FTP data stream, and is used when the FTP server executes the command and reply handlers for the FTP REST or RETR commands.

RESTPos is updated in the command reply handler for the REST command for an Authenticated FTP client connection. The default value for RESTPos is 0. RESTPos is read in the command reply handler for the RETR command, and the FTP Data stream is moved to the indicated position prior to beginning the transfer operation on the DataChannel.


TIdFTPServerThread.Username
TIdFTPServerThread, See Also
Represents the account identity for client connection authentication.
property Username: string;
Description
Username is a String property that represents the account identity used for authenticating the FTP client connection. UserName is read from the client connection and provided to the FTP USER command reply handler used in the FTP server implementation, or to the OnCommandUSER event handler when UserAccounts are not maintained by the FTP server.

When Username contains the value "anonymous" or "guest", the AccessLevel for the client connection is set to idaAnonymousUser. Otherwise, UserAccounts on the FTP server are used to perform account authorization and determine the AccessLevel for the account.


TIdFTPServerThread.UserType
TIdFTPServerThread
Indicate the user account type and processing to perform during account authentication.
property UserType: TIdFTPUserType;
Description
UserType is a TIdFTPUserType property that represents the type of user account used to open the threaded client connection to the FTP server. UserType is updated when the command event handler for the FTP USER command verb receives and processes the account identity for the client connection.

UserType will be given the value utAnonymousUser when AllowAnonymousLogin is True, and AnonymousAccounts contains the account identitity provided as a parameter to the command event handler. Username is given the value in the parameter to the command event handler.

If AllowAnonymousLogin is False or the account identity is not present in AnonymousAccounts, UserType is assigned the value utNormalUser and Username is given the contents of the parameter for the FTP USER command.

UserType will contain the value utNone when an account identity is not provided.

UserType is subsequently used when the FTP PASS command verb is received from the client connection, and the account must be authorized using the credentials provided for the user account. UserType will control the authorization mechanism used for the threaded client connection.

When UserType contains the value utAnonymousUser, the server implementation will require that the password for an anonymous account contain a valid email address when TIdFTPServer.AnonymousPassStrictCheck is True. Otherwise the anonymous account must provide a non-blank password containing any value. When these condition are met, Authenticated will contain True and the parameter value for the command event handler is assigned to the Password property. If either condition is not met, UserType will revert to the value utNone and Authenticated will contain False.

When UserType contains the value utNormalUser, the server implementation will authenticate using the account information in TIdFTPServer.UserAccounts when assigned. The UserAccounts collection is used to perform TIdUserAccounts.AuthenticateUser for the account identity and credentials specified in the Username and Password properties. Authenticated will indicate the results of the authorization process.

Use TIdFTPServer.OnUserLogin to perform account authentication when TIdAccount object instance are not used in the server implementation. Use TIdFTPServer.OnAfterUserLogin to perform additional logging or to extend the authorization process for the threaded client connection.

The default value for UserType is utNone, as assigned in the Create constructor.


TIdFTPServerThread.Create
TIdFTPServerThread
Constructor for the object instance
constructor Create(ACreateSuspended: Boolean = True; const ADefaultDataPort: Integer = IdPORT_FTP_DATA); reintroduce;
Parameters
ACreateSuspended: Boolean = True
Indicates that the thread is Suspended prior to execution.
Description
Create is the constructor for the object instance. Create calls the inherited Create method using the value in ACreateSuspended to indicate the is the thread is Suspended prior to execution. Create calso constructs and initializes the DataChannel for the client connection, and calls ReInitialize to insure that the default values for the thread are established.

TIdFTPServerThread.Destroy
TIdFTPServerThread, See Also
Frees the object instance.
destructor Destroy; override;
Description
Destroy is the destructor for the object instance. Destroy frees and releases resources allocated to the DataChannel property prior to calling the inherited Destroy method.

Created with Doc-O-Matic 2 donated to Project JEDI. Commercial license available from the Doc-O-Matic site.