module Puma::Const

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.

The constants are frozen because Hash#[]= when called with a String key dups the String UNLESS the String is frozen. This saves us therefore 2 object allocations when creating the env hash later.

While Puma 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.

Constants

CGI_VER
CHUNKED
CHUNK_SIZE

The basic max request size we'll try to read.

CLOSE
CLOSE_CHUNKED
CODE_NAME
COLON
CONNECTION_CLOSE
CONNECTION_KEEP_ALIVE
CONTENT_LENGTH
CONTENT_LENGTH2
CONTENT_LENGTH_S
CONTENT_TYPE
CONTINUE
DATE
ERROR_400_RESPONSE

Indicate that we couldn't parse the request

ERROR_404_RESPONSE

The standard empty 404 response for bad requests. Use Error4040Handler for custom stuff.

ERROR_408_RESPONSE

The standard empty 408 response for requests that timed out.

ERROR_500_RESPONSE

Indicate that there was an internal error, obviously.

ERROR_503_RESPONSE

A common header for indicating the server is too busy. Not used yet.

ETAG
ETAG_FORMAT

ETag is based on the apache standard of hex mtime-size-inode (inode is 0 on win32)

FAST_TRACK_KA_TIMEOUT
FIRST_DATA_TIMEOUT

The default number of seconds to wait until we get the first data for the request

GATEWAY_INTERFACE
GET
HALT_COMMAND
HIJACK
HIJACK_IO
HIJACK_P
HOST
HTTP
HTTPS
HTTPS_KEY
HTTP_10
HTTP_10_200
HTTP_11
HTTP_11_100
HTTP_11_200
HTTP_CONNECTION
HTTP_EXPECT
HTTP_HOST
HTTP_IF_MODIFIED_SINCE
HTTP_IF_NONE_MATCH
HTTP_VERSION
HTTP_X_FORWARDED_FOR
KEEP_ALIVE
LAST_MODIFIED
LINE_END
LOCALHOST
LOCALHOST_ADDR
LOCALHOST_IP
MAX_BODY

Maximum request body size before it is moved out of memory and into a tempfile for reading.

MAX_HEADER

This is the maximum header that is allowed before a client is booted. The parser detects this, but we'd also like to do this as well.

NEWLINE
PATH_INFO
PERSISTENT_TIMEOUT

The default number of seconds for another request within a persistent session.

PORT_443
PORT_80
PUMA_CONFIG
PUMA_PEERCERT
PUMA_SERVER_STRING
PUMA_SOCKET
PUMA_TMP_BASE
PUMA_VERSION
QUERY_STRING
RACK_AFTER_REPLY
RACK_INPUT
RACK_URL_SCHEME
REDIRECT
REMOTE_ADDR
REQUEST_METHOD
REQUEST_PATH
REQUEST_URI

The original URI requested by the client.

RESTART_COMMAND
SCRIPT_NAME
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SOFTWARE
SHUTDOWN_GRACE_TIME

How long, after raising the ForceShutdown of a thread during forced shutdown mode, to wait for the thread to try and finish up it's work before leaving the thread to die on the vine.

SLASH
STATUS_FORMAT

A frozen format for this is about 15% faster

STOP_COMMAND
TRANSFER_ENCODING
TRANSFER_ENCODING2
TRANSFER_ENCODING_CHUNKED
WRITE_TIMEOUT

How long to wait when getting some write blocking on the socket when sending data back