-- File: Http.mesa - last edit:
-- AOF 12-Jan-97 18:35:25
-- DLion 20-Feb-96 21:55:44
-- Copyright (C) 1995, 1996, 1997 by Freier's Garage. All rights reserved.
DIRECTORY
Ascii USING [NUL],
Environment USING [Block],
Format USING [StringProc],
MFile USING [Handle],
System USING [gmtEpoch, GreenwichMeanTime],
TcpStream USING [Handle],
WebLog USING [LogHandle];
Http: DEFINITIONS =
BEGIN
Handle: TYPE = LONG POINTER TO Object;
Object: TYPE = RECORD[
--the object maintenance stuff
reset: PROC[Handle], --rest the non-sticky bits (for persist)
destroy: PROC[Handle], --destroy everything (including container)
--This is all the local parsing stuff
pending: CHAR ¬ Ascii.NUL,
current: LONG STRING ¬ NIL,
oneByte: Environment.Block,
getByte: PROC[Handle],
lws: PROC[Handle] RETURNS[BOOLEAN],
flush: PROC[Handle] RETURNS[BOOLEAN],
skip: PROC[Handle, CHARACTER] RETURNS[BOOLEAN],
token: PROC[Handle, CHARACTER] RETURNS[LONG STRING],
tsH: TcpStream.Handle, --our contact back to the client
logging: WebLog.LogHandle, --to log our activity
mfH: MFile.Handle ¬ NIL, --the file we're manipulating
filename: LONG STRING ¬ NIL, --url modified for Tajo's use
status: CARDINAL ¬ 200, --of the operation
--The result of the parsing, etc.
persist: BOOLEAN ¬ FALSE,
noCache: BOOLEAN ¬ FALSE,
url: LONG STRING ¬ NIL,
referer: LONG STRING ¬ NIL,
location: LONG STRING ¬ NIL,
contentLength: LONG CARDINAL ¬ 0,
method: {null, get, head, post} ¬ null,
date: System.GreenwichMeanTime ¬ TRASH,
expires: System.GreenwichMeanTime ¬ TRASH,
lastModified: System.GreenwichMeanTime ¬ System.gmtEpoch,
modifiedSince: System.GreenwichMeanTime ¬ System.gmtEpoch,
mimeVersion: LONG STRING ¬ NIL];
Property: TYPE = MACHINE DEPENDENT {
contentEncoding(100000B), contentType(100001B), expires(100002B)};
Create: PROC[tsH: TcpStream.Handle] RETURNS[Handle];
ParseError: ERROR[where: ParseErrorType];
ParseErrorType: TYPE = {
allow, authorization, connection, contentEncoding, contentLength, contentType,
date, endOfStream, expires, from, httpVersion, ifModifiedSince,
lastModified, method, mimeVersion, parseRequest, referer, requestLine,
requestURI, pragma, space, userAgent};
ServeError: ERROR[where: ServeErrorType];
ServeErrorType: TYPE = {okay, invalid};
ParseRequest: PROC[Handle];
ServeRequest: PROC[Handle];
HttpDate: PROC[
proc: Format.StringProc, time: System.GreenwichMeanTime,
clientData: LONG POINTER ¬ NIL];
YafDate: PROC[
proc: Format.StringProc, time: System.GreenwichMeanTime,
clientData: LONG POINTER ¬ NIL];
END.... --Http.mesa--