summaryrefslogtreecommitdiff
path: root/appl/svc/httpd/httpd.m
blob: 7d4c0dcff14f121a51d1a1e0cdc6caee131a055e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Httpd: module {
	
	Internal, TempFail, Unimp, UnkVers, BadCont, BadReq, Syntax, 
	BadSearch, NotFound, NoSearch , OnlySearch, Unauth, OK : con iota;	
	
	SVR_ROOT : con "/services/httpd/root/";
	HTTPLOG : con "/services/httpd/httpd.log";
	DEBUGLOG : con "/services/httpd/httpd.debug";
	HTTP_SUFF : con "/services/httpd/httpd.suff";
	REWRITE   : con "/services/httpd/httpd.rewrite";
	MAGICPATH : con "/dis/svc/httpd/"; # must end in /
	
	Private_info : adt{
		# used in parse and httpd
		bufio: Bufio;
		bin,bout : ref Bufio->Iobuf;
		logfile,dbg_log : ref Sys->FD;
		cache : Cache;
		eof : int;
		getcerr : string;
		version : string;
		okencode, oktype : list of ref Contents->Content;
		host : string; # initialized to mydomain just 	
			       # before parsing header
		remotesys, referer : string;
		modtime : int;
		# used by /magic for reading body
		clength : int;
		ctype : string;
		#only used in parse
		wordval : string;
		tok,parse_eof : int;
		mydomain,client : string;
		oklang : list of ref Contents->Content;
	};
	Request: adt {
		method, version, uri, search: string;
	};
	init: fn(ctxt: ref Draw->Context, argv: list of string);
};

Cgi: module{
	init: fn(g: ref Httpd->Private_info, req: Httpd->Request);
};