FastCGI: module { init: fn(ctxt: ref Draw->Context, args: list of string); Request : adt { id : int; records : list of ref Record; }; Record : adt { pick { Begin_Request => role : int; flags : byte; reserved : array of byte; Abort_Request => End_Request => application_status : int; protocol_status : byte; reserved : array of byte; Params => params : list of (string, string); Stdin or Stdout or Stderr or Data => data : array of byte; Get_Values => values : list of (string, string); Get_Values_Result => results : list of (string, string); } tostring : fn(r : self ref Record) : string; }; Httpd : adt { conn : Sys->Connection; io : ref Iobuf; server_id : int; active_records : ref Record; read_records: fn(h : self ref Httpd, consumer : chan of ref Record); open_io: fn(h : self ref Httpd) : int; read_header: fn(h : self ref Httpd) : (int, int, int, big); read_name_value_pairs: fn(h : self ref Httpd, content_length: int) : (int, list of (string, string)); read_varstring_length: fn(h : self ref Httpd) : (int, int); }; # record types (rtype above) BEGIN_REQUEST : con 1; ABORT_REQUEST : con 2; END_REQUEST : con 3; PARAMS : con 4; STDIN : con 5; STDOUT : con 6; STDERR : con 7; DATA : con 8; GET_VALUES : con 9; GET_VALUES_RESULT : con 10; Record_List : adt { }; };