Author: Venkata N. Padmanabhan (supervised by Jeffrey C. Mogul) --------------------------------------------------------------- Salient features ---------------- * support for persistent connections with clients (with client-side mods.) * 2 new HTTP methods for pipelining requests: GETLIST: given a list of URLs, get all the correspoding documents GETALL: given the URL for an HTML document, get that document and all its inlined images that reside on that server. * fully interoperable with unmodified clients Implementation Details ---------------------- The first and most important task is for each of the client and server to inform each other that it is 'new', i.e. supports persistent connections. This is done in an unobtrusive fashion so that it interoperates with unmodified implementations as well. * Persistent connnections: The client sends its request with the additional field "Client-type: NEW" in the MIME headers (see get_mime_headers() in http_mime.c) to indicate that it supports (and desires) a persistent connection. In response to such a request, the server process handling the request continues to wait for further requests, and the client-server connection becomes persistent. Also in its response to the client, the server includes the header line "NEW" (see begin_http_header() in http_log.c) to tell the client that it supports persistent connections as well. The connection persists until one of the following happens: - a server-side script is executed in response to a client request - this particular server process is chosen as the victim when the server wishes to shed load - the connection remains idle beyond a threshold In each of these cases, the connection to the client is closed. * Pipelining requests (GETLIST/GETALL): Both these methods are implemented as ordinary GETs with an additional field in the MIME headers. This field is either "Command: GETLIST" or "Command: GETALL (see get_mime_headers() in http_mime.c). According to the primitive, different actions are taken: - GETLIST: Since in the current implementation GETLIST is implemented as just a bunch of GETs sent back-to-back, the server on receiving a GETLIST request does little more than making note of it. This information could be used to guide other decisions. For instance, a GETLIST could treated as a hint that a burst of requests is going to arrive, so the server could defer activities such as prefetching. - GETALL: If the GETALL is for an HTML document, the server parses the document to determine URLs of all inlined images that reside on the server and sends back corresponding image data as well (see sendall_fd() in http_request.c which invokes code in HTMLparse.c to do the parsing). Organization of the code etc. ---------------------------- ./src: contains all the source files and the makefile for httpd. httpd.c: contains the main server code that forks off a new process in response to a new connection request from a client http_request.c: parses the request and invokes the appropriate function depending on the type of request (GET, PUT etc.) http_mime.c: parses the MIME headers in the request. HTMLparse.c: Mosaic code that parses HTML, adapted to support GETALL ./conf: the configuration files. access.conf, httpd.conf, srm.conf: allow swetting of several parameters including port # for the server, the root of the server's document tree, etc. The files with the ".conf-dist" extensions are the original NCSA configuration files with comments describing the various parameters. ./logs: the server logs. ./icons: a few commonly used icons ./cgi-bin: a few CGI scripts Building the server ------------------- First set AUX_FLAGS and EXTRA_LIBS according to the system you are compiling on. Then in ./src, type "make " where is the type of the architecture. I have tested this only for DEC MIPS running ULTRIX and DEC Alpha runing OSF. The executable "httpd" is placed in ./ Running the server ------------------ Type ./httpd [-d server_root] [-f server_confname] [-v] -d server_root: root of the server source tree, i.e. ./ -f server_confname: name of the server configuration file; the default is conf/httpd.conf -v : just prints the version number Common errors ------------- 1. The server port (in conf/httpd.conf) is set to 80 but the server is not being run as root. Use a port number larger than 1023. 2. The server is run a second time, while an older invocation is still active. Either kill the old invocation or use a new port number. Changed or added source modules: -------------------------------- src/HTML.h src/HTMLamp.h src/HTMLparse.c src/http_access.c src/http_delete.c src/http_dir.c src/http_get.c src/http_log.c src/http_mime.c src/http_post.c src/http_put.c src/http_request.c src/http_script.c src/httpd.c src/httpd.h src/util.c