auto-generate Unicorn::Const::UNICORN_VERSION
[unicorn.git] / lib / unicorn / const.rb
blob51d7394678c95d87f8638af5735606517da28f56
1 # -*- encoding: binary -*-
3 # :enddoc:
4 # Frequently used constants when constructing requests or responses.
5 # Many times the constant just refers to a string with the same
6 # contents.  Using these constants gave about a 3% to 10% performance
7 # improvement over using the strings directly.  Symbols did not really
8 # improve things much compared to constants.
9 module Unicorn::Const
10   # default TCP listen host address (0.0.0.0, all interfaces)
11   DEFAULT_HOST = "0.0.0.0"
13   # default TCP listen port (8080)
14   DEFAULT_PORT = 8080
16   # default TCP listen address and port (0.0.0.0:8080)
17   DEFAULT_LISTEN = "#{DEFAULT_HOST}:#{DEFAULT_PORT}"
19   # The basic request body size we'll try to read at once (16 kilobytes).
20   CHUNK_SIZE = 16 * 1024
22   # Maximum request body size before it is moved out of memory and into a
23   # temporary file for reading (112 kilobytes).  This is the default
24   # value of client_body_buffer_size.
25   MAX_BODY = 1024 * 112
27   # :stopdoc:
28   # common errors we'll send back
29   # (N.B. these are not used by unicorn, but we won't drop them until
30   #  unicorn 5.x to avoid breaking Rainbows!).
31   ERROR_400_RESPONSE = "HTTP/1.1 400 Bad Request\r\n\r\n"
32   ERROR_414_RESPONSE = "HTTP/1.1 414 Request-URI Too Long\r\n\r\n"
33   ERROR_413_RESPONSE = "HTTP/1.1 413 Request Entity Too Large\r\n\r\n"
34   ERROR_500_RESPONSE = "HTTP/1.1 500 Internal Server Error\r\n\r\n"
36   EXPECT_100_RESPONSE = "HTTP/1.1 100 Continue\r\n\r\n"
37   EXPECT_100_RESPONSE_SUFFIXED = "100 Continue\r\n\r\nHTTP/1.1 "
39   HTTP_RESPONSE_START = ['HTTP', '/1.1 ']
40   HTTP_EXPECT = "HTTP_EXPECT"
42   # :startdoc:
43 end
44 require 'unicorn/version'