#0:do_login_command is called whatever commands are
used before connection as a character (or guest). So if you telnet to
the moo, there are certain commands (like help, welcome, @who,
connect), which you can use and which are all defined on the $login
object as ``any none any'' verbs.
As an example, the
#0:do_login_command calls the $login:connect
verb after a user entered 'connect xxx yyy'. Before
authentication the user is assigned a negative number and after
connection his client connection will be ``attached'' to his own character
and further things not discussed here will happen.
So each ``GET'' request to the moo (i.e. a www client requesting an URL)
also goes first through the
#0:do_login_command. Command parsing
is all done by $login(#10) verbs as you can see here:
#0:"do_login_command" this none this
19: args = $login:parse_command(@args);
20: return $login:(args)(@listdelete(args, 1));
In principle, other http requests could also be parsed and answered (such as post etc) by putting verbs of that name on $login. (Post is being developed experimentally at the moment at MOOtiny by Jeny 25/9/95).
In the case of a ``GET'' http request the $login:get verb will be executed.
This verb rebuilds the URL in some ways (more later ...)
and passes the contents of 'GET ....' command to the www layer.
It calls $web:hdisplay like this:
keep = $web:hdisplay($web:get_htext(req, rc, player));
req is the URL, e.g.
rc is the headers received (client/referer information), e.g.
"User-Agent: Mozilla/1.1N (X11; I; SunOS 5.4 sun4m)",
"Accept: */*", "Accept: image/gif", "Accept: image/x-xbitmap",
"Accept: image/jpeg", ""}
player is player no, e.g. #-451
A note about client headers: As well as the request for a certain page, the web client also sends headers such as identifying what the client is, sometimes asking the server to only send the page if it's been modified since the last time it got it, and so on. See the documentation on the offical http protocol page for more details (e.g. study the HTTP/1.0 Internet Draft.
If :hdisplay doesn't do a server push (returning a positive value) the connection is closed as expected from a ordinary http server.