Switch to edit mode.
Name(s): serve_page1: "This verb is called when the web server wants to serve a page."
2: {object, dobjstr, iobjstr} = args
3: caller:isa($webber) && caller == player || raise(E_PERM)
4: if (x = index(dobjstr, "?"))
5: prepstr = dobjstr[1..x - 1]
6: dobjstr = dobjstr[x..$]
7: dobj = $www:parse_CGI(dobjstr)
8: if (!dobj && dobjstr != "?")
9: "A form with a single element called 'isindex' is special."
10: dobj = $www:parse_CGI("?isindex=" + dobjstr[2..$])
11: endif
12: else
13: prepstr = dobjstr
14: dobjstr = ""
15: dobj = {}
16: endif
17: prepstr = this:decode_cgi_bin(prepstr)
18: if (`player.content_type[1..9] ! E_RANGE' == "multipart")
19: {iobj, multipart_types} = $www:parse_multipart(iobjstr, player.multipart_boundary)
20: player.multipart_types = multipart_types
21: else
22: iobj = $www:parse_CGI(iobjstr)
23: endif
24: for x in (this.spies)
25: x:tell(player:title(), " now being served.")
26: endfor
27: if (!valid(object) || !$recycler:valid(object))
28: object = $www.error
29: dobjstr = iobjstr = prepstr = ""
30: dobj = iobj = {}
31: endif
32: if (prepstr && prepstr[1] in {".", ":", "!", ",", ";", "%"} || (length(prepstr) > 2 && prepstr[1..3] in {"%3A", "%21", "%2C", "%3B"}))
33: "Show Examine page instead."
34: $www.exam:tell_www_page(object)
35: elseif (!object:has_callable_verb("tell_www_page"))
36: "#1 and $garbage are special, they don't have web verbs"
37: prepstr = ".:!"
38: dobjstr = iobjstr = ""
39: dobj = iobj = {}
40: $www.exam:tell_www_page(object)
41: else
42: object:tell_www_page()
43: endif
44: if (!object:isa($fastweb) || iobjstr || prepstr)
45: "Don't bother logging FastWeb transactions."
46: `$stats:log_www() ! ANY => this.owner:tell("$stats:log_www is blowing up!")'
47: $www.total_hits = $www.total_hits + 1
48: `object.www_counter = object.www_counter + 1 ! E_PROPNF'
49: $wiz_utils:autoextend(object)
50: endif
51: "Last modified by Dax (#789) on Fri Dec 16 03:21:03 2005 MST."