Copyright 2005 Fourthought, Inc. (USA). Detailed license and copyright information: http://4suite.org/COPYRIGHT Project home, documentation, distributions: http://4suite.org/
Classes:
|
Requires in its constructor a HttpConnection instance and a ServerConfig instance. Instance variables: - connection: a HttpConnection instance - server: the ServerConfig instance passed in the constructor -- used for logging, document root, authentication, etc. - rfile: request read stream - wfile: response write stream - request: the original Request-Line from the request [RFC 2616 sect. 5.1] - method: the Method for this request (like 'GET', 'POST', etc.) [RFC 2616 sect. 5.1.1] - unparsed_uri: the original Request-URI (typically URL-encoded) [RFC 2616 sect. 5.1.2] - unparsed_path: the path portion of the Request-URI (assumes URI consists of an abs_path [RFC 2616 sect. 5.1.2] and, because urllib is buggy, that the path stops at the first ';' or '?') - unparsed_params: because urllib is buggy, the part of path component of the Request-URI after the first ';'. This is a param [RFC 2396 sect. 3.3] - unparsed_args: the query component of the Request-URI [RFC 2396 sect. 3.4] - protocol: the protocol string as sent by the client, or 'HTTP/0.9' - version: a float representing the version portion of the protocol - headers_in: dictionary-like object of request headers - path: the URL-decoded form of the unparsed_uri_path - filename: the real path to the requested resource in the repo - args: dictionary of unparsed_uri_args as returned by cgi.parse_qs() - auth_type: authorization type from Authorization header of request - user: username decoded from Authorization header of request - password: password decoded from Authorization header of request - body: request body as a string (bytes) - headers_out: dictionary-like object of response headers
Raises a ValueError exception if the conversion failed.
First the hostname returned by gethostbyaddr() is checked, then possibly existing aliases. In case no FQDN is available, hostname is returned.
Given two query string argument dictionaries from cgi.parse_qs(), return a new dictionary of the combined arguments, appending the values from args2 to the values for args1 for each duplicate key.
If the request line is in some way malformed, an error repsonse is written directly to the wfile stream and false is returned, otherwise true indicates success. Progress and errors are logged to server.errorLog.
Arguments are the error code, and a detailed message. The detailed message defaults to the short entry matching the response code. This sends an error response (so it must be called before any output has been generated), logs the error, and finally sends a piece of HTML explaining the error to the user.