Module: Unicorn::Const

Defined in:
lib/unicorn/const.rb

Overview

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.

Constant Summary collapse

UNICORN_VERSION =

The current version of Unicorn, currently 2.0.0

"2.0.0"
DEFAULT_HOST =

default TCP listen host address (0.0.0.0, all interfaces)

"0.0.0.0"
DEFAULT_PORT =

default TCP listen port (8080)

8080
DEFAULT_LISTEN =

default TCP listen address and port (0.0.0.0:8080)

"#{DEFAULT_HOST}:#{DEFAULT_PORT}"
CHUNK_SIZE =

The basic request body size we'll try to read at once (16 kilobytes).

16 * 1024
MAX_BODY =

Maximum request body size before it is moved out of memory and into a temporary file for reading (112 kilobytes).

1024 * 112
ERROR_400_RESPONSE =

:stopdoc: common errors we'll send back

"HTTP/1.1 400 Bad Request\r\n\r\n"
ERROR_500_RESPONSE =
"HTTP/1.1 500 Internal Server Error\r\n\r\n"
EXPECT_100_RESPONSE =
"HTTP/1.1 100 Continue\r\n\r\n"
HTTP_EXPECT =
"HTTP_EXPECT"