Oberon || Library || Module Index || Search Engine || Definition || Module
TYPE Message = POINTER TO MessageRec; TYPE MessageRec = RECORD (Messages.MessageRec) request: FTPRequests.Request; response: FTPResponses.Response; markEventType: Events.EventType; END;
TYPE Session = POINTER TO SessionRec; TYPE SessionRec = RECORD (Services.ObjectRec) authorized: BOOLEAN; finished: BOOLEAN; END;
PROCEDURE Create(VAR session: Session); PROCEDURE ProcessRequest(session: Session; request: FTPRequests.Request; markEventType: Events.EventType; VAR response: FTPResponses.Response);
During the initialization phase of a FTP session for a new network connection,
State is maintained by various handlers that were installed by Messages.InstallHandler on base of disciplines, and some public session components:
ProcessRequest checks whether request is acceptable at the current state (in dependence of authorized), processes some simple commands itself, and converts all other requests into messages (of type Message) and sends them to session, using Messages.Send. Following commands are implemented by ProcessRequest:
If, after processing of Messages.Send, the response field of the message remains NIL, an error code is returned: either 450 (as indication for temporary failures) if error events were found, or 502 (as indication for an unknown or unsupported command).
Some commands of the FTP protocol request some intermediate responses, called marks, on the command channel as the transfer on the separate channel begins or ends. Marks are to be delivered by raising events of type FTPResponses.Event using markEventType as event type.
Oberon || Library || Module Index || Search Engine || Definition || Module