1WebgetUtils: module 2{ 3 PATH: con "/dis/svc/webget/wgutils.dis"; 4 5 Req: adt 6 { 7 index: int; 8 method: string; 9 bodylen: int; 10 reqid: string; 11 loc: string; 12 types: string; 13 cachectl: string; 14 auth: string; 15 body: array of byte; 16 url: ref Url->ParsedUrl; 17 reply: ref Message->Msg; 18 }; 19 20 Fid: adt 21 { 22 fid: int; 23 link: cyclic ref Fid; 24 reqs: array of ref Req; 25 writer: int; 26 readr: int; 27 nbyte: int; 28 nread: int; 29 rc: Sys->Rread; 30 }; 31 32 M: Message; 33 B: Bufio; 34 S: String; 35 U: Url; 36 DI: Dial; 37 38 # media types (must track mnames array in wgutils.b) 39 UnknownType, 40 TextPlain, TextHtml, 41 ApplPostscript, ApplRtf, ApplPdf, 42 ImageJpeg, ImageGif, ImageIef, ImageTiff, 43 ImageXCompressed, ImageXCompressed2, ImageXXBitmap, 44 AudioBasic, 45 VideoMpeg, VideoQuicktime, Soap, TextXml: con iota; 46 47 init : fn(m: Message, s: String, b: Bufio, u: Url, di: Dial, logfd: ref Sys->FD); 48 usererr: fn(r: ref Req, msg: string) : ref Message->Msg; 49 okprefix: fn(r: ref Req, mrep: ref Message->Msg); 50 getdata: fn(io: ref Bufio->Iobuf, m: ref Message->Msg, 51 accept: string, url: ref Url->ParsedUrl) : string; 52 fixaccept: fn(a: string) : string; 53 log: fn(c: ref Fid, msg: string); 54}; 55