| Module | Mongrel::Const |
| In: |
lib/mongrel.rb
|
Frequently used constants when constructing requests or responses. Many times the constant just refers to a string with the same contents. Using these constants gave about a 3% to 10% performance improvement over using the strings directly. Symbols did not really improve things much compared to constants.
While Mongrel does try to emulate the CGI/1.2 protocol, it does not use the REMOTE_IDENT, REMOTE_USER, or REMOTE_HOST parameters since those are either a security problem or too taxing on performance.
| PATH_INFO | = | "PATH_INFO" | This is the part of the path after the SCRIPT_NAME. URIClassifier will determine this. | |
| SCRIPT_NAME | = | "SCRIPT_NAME" | This is the intial part that your handler is identified as by URIClassifier. | |
| REQUEST_URI | = | 'REQUEST_URI' | The original URI requested by the client. Passed to URIClassifier to build PATH_INFO and SCRIPT_NAME. | |
| CONTENT_LENGTH | = | 'CONTENT_LENGTH' | Content length (also available as HTTP_CONTENT_LENGTH). | |
| HTTP_CONTENT_LENGTH | = | 'HTTP_CONTENT_LENGTH' | Content length (also available as CONTENT_LENGTH). | |
| CONTENT_TYPE | = | 'CONTENT_TYPE' | Content type (also available as HTTP_CONTENT_TYPE). | |
| HTTP_CONTENT_TYPE | = | 'HTTP_CONTENT_TYPE' | Content type (also available as CONTENT_TYPE). | |
| GATEWAY_INTERFACE | = | 'GATEWAY_INTERFACE' | Gateway interface key in the HttpRequest parameters. | |
| GATEWAY_INTERFACE_VALUE | = | 'CGI/1.2' | We claim to support CGI/1.2. | |
| REMOTE_ADDR | = | 'REMOTE_ADDR' | Hosts remote IP address. Mongrel does not do DNS resolves since that slows processing down considerably. | |
| REMOTE_HOST | = | 'REMOTE_HOST' | This is not given since Mongrel does not do DNS resolves. It is only here for completeness for the CGI standard. | |
| SERVER_NAME | = | 'SERVER_NAME' | The name/host of our server as given by the HttpServer.new(host,port) call. | |
| SERVER_PORT | = | 'SERVER_PORT' | The port of our server as given by the HttpServer.new(host,port) call. | |
| SERVER_PROTOCOL | = | 'SERVER_PROTOCOL' | Official server protocol key in the HttpRequest parameters. | |
| SERVER_PROTOCOL_VALUE | = | 'HTTP/1.1' | Mongrel claims to support HTTP/1.1. | |
| SERVER_SOFTWARE | = | 'SERVER_SOFTWARE' | The actual server software being used (it’s Mongrel man). | |
| MONGREL_VERSION | = | 'Mongrel 0.2.2' | Current Mongrel version (used for SERVER_SOFTWARE and other response headers). | |
| ERROR_404_RESPONSE | = | "HTTP/1.1 404 Not Found\r\nConnection: close\r\nServer: #{MONGREL_VERSION}\r\n\r\nNOT FOUND" | The standard empty 404 response for bad requests. Use Error4040Handler for custom stuff. | |
| ERROR_503_RESPONSE | = | "HTTP/1.1 503 Service Unavailable\r\n\r\nBUSY" | A common header for indicating the server is too busy. Not used yet. | |
| CHUNK_SIZE | = | (16 * 1024) | The basic max request size we’ll try to read. |