Module: Puma::Const

### Home Classes Methods

### In Files

- lib/puma/const.rb

### Files

- Manifest.txt

### Class/Module Index

Quicksearch

- Puma
- Puma::App
- Puma::App::Status
- Puma::Binder
- Puma::CLI
- Puma::Client
- Puma::Cluster
- Puma::Cluster::Worker
- Puma::CommonLogger
- Puma::ConfigDefault
- Puma::Configuration
- Puma::Configuration::ConfigMiddleware
- Puma::ConnectionError
- Puma::Const
- Puma::ControlCLI
- Puma::DSL
- Puma::Delegation
- Puma::Events
- Puma::Events::DefaultFormatter
- Puma::Events::PidFormatter
- Puma::IOBuffer
- Puma::JRubyRestart
- Puma::JavaIOBuffer
- Puma::MiniSSL
- Puma::MiniSSL::Context
- Puma::MiniSSL::SSLError
- Puma::MiniSSL::Server
- Puma::MiniSSL::Socket
- Puma::NullIO
- Puma::Rack
- Puma::Rack::Builder
- Puma::Rack::Options
- Puma::Rack::URLMap
- Puma::Reactor
- Puma::Runner
- Puma::Server
- Puma::Single
- Puma::TCPLogger
- Puma::ThreadPool
- Puma::ThreadPool::AutoTrim
- Puma::ThreadPool::Reaper
- Puma::UnsupportedOption
- Puma::Util
- Puma::Util::HeaderHash
- OpenSSL
- OpenSSL::SSL
- OpenSSL::SSL::SSLServer
- Rack
- Rack::Handler
- Rack::Handler::Puma
- IO
- IO::WaitReadable
- Object
- Process
- String

No matching classes.

# 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
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
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
HEAD
HIJACK
HIJACK_IO
HIJACK_P
HOST
HTTP
HTTPS
HTTPS_KEY
HTTP_10
HTTP_10_200
HTTP_11
HTTP_11_200
HTTP_CONNECTION
HTTP_HOST
HTTP_IF_MODIFIED_SINCE
HTTP_IF_NONE_MATCH
HTTP_VERSION
HTTP_X_FORWARDED_FOR
KEEP_ALIVE
LAST_MODIFIED
LINE_END
LOCALHOST
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_SOCKET
PUMA_TMP_BASE
PUMA_VERSION
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
SLASH
STATUS_FORMAT

  A frozen format for this is about 15% faster

STOP_COMMAND
TRANSFER_ENCODING
TRANSFER_ENCODING_CHUNKED
WRITE_TIMEOUT

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.