Oberon || Library || Module Index || Search Engine || Definition || Module


Ulm's Oberon Library:
FTPResponses


NAME

FTPResponses - construct and send FTP responses

SYNOPSIS

TYPE Response = POINTER TO ResponseRec;
TYPE ResponseRec =
      RECORD
	 (PersistentDisciplines.ObjectRec)
	 code: INTEGER; (* 3 digits, see RFC 959 *)
	 shorttext: ARRAY 80 OF CHAR; (* one line of text or "" *)
	 text: Streams.Stream; (* may be NIL *)
      END;


TYPE Event = POINTER TO EventRec; TYPE EventRec = RECORD (Events.EventRec) response: Response; END;

PROCEDURE Create(VAR response: Response; code: INTEGER; text: ARRAY OF CHAR); PROCEDURE SendResponse(s: Streams.Stream; response: Response) : BOOLEAN;

DESCRIPTION

FTPResponses provides in Response a persistent type for outgoing FTP responses, a procedure that sends responses over network connections, and an event type that may be used for logging (see FTPLoggers) or marks (see FTPSessions).

A FTP response consists in conformance to RFC 959 of a

Create may be used to create responses. In dependence of the length of text, the message is either stored into shorttext, or, in case of longer messages, represented as persistent text that is accessible as stream.

SendResponse sends response in conformance to RFC 959 to s. Line terminators which are to be represented as simple ASCII.nl (in conformance to StreamDisciplines) will be converted into sequences of ASCII.cr and ASCII.lf. Likewise, SendResponse takes care of the 0FFX telnet code escape characters and doubles them.

DIAGNOSTICS

SendResponse returns FALSE in case of failures but does not generate any error events on its own.

SEE ALSO

FTPRequests
sibling of this module that offers a persistent type for FTP requests and an operation that allows to read them from network connections.

Edited by: borchert, last change: 2001/05/08, revision: 1.3, converted to HTML: 2001/05/08

Oberon || Library || Module Index || Search Engine || Definition || Module