02e29c76a57c8341de622832031ed88e672bcad4
[unicorn.git] / lib / unicorn / const.rb
blob02e29c76a57c8341de622832031ed88e672bcad4
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
11   UNICORN_VERSION = "4.5.0pre1"
13   # default TCP listen host address (0.0.0.0, all interfaces)
14   DEFAULT_HOST = "0.0.0.0"
16   # default TCP listen port (8080)
17   DEFAULT_PORT = 8080
19   # default TCP listen address and port (0.0.0.0:8080)
20   DEFAULT_LISTEN = "#{DEFAULT_HOST}:#{DEFAULT_PORT}"
22   # The basic request body size we'll try to read at once (16 kilobytes).
23   CHUNK_SIZE = 16 * 1024
25   # Maximum request body size before it is moved out of memory and into a
26   # temporary file for reading (112 kilobytes).  This is the default
27   # value of client_body_buffer_size.
28   MAX_BODY = 1024 * 112
30   # :stopdoc:
31   # common errors we'll send back
32   # (N.B. these are not used by unicorn, but we won't drop them until
33   #  unicorn 5.x to avoid breaking Rainbows!).
34   ERROR_400_RESPONSE = "HTTP/1.1 400 Bad Request\r\n\r\n"
35   ERROR_414_RESPONSE = "HTTP/1.1 414 Request-URI Too Long\r\n\r\n"
36   ERROR_413_RESPONSE = "HTTP/1.1 413 Request Entity Too Large\r\n\r\n"
37   ERROR_500_RESPONSE = "HTTP/1.1 500 Internal Server Error\r\n\r\n"
39   EXPECT_100_RESPONSE = "HTTP/1.1 100 Continue\r\n\r\n"
40   EXPECT_100_RESPONSE_SUFFIXED = "100 Continue\r\n\r\nHTTP/1.1 "
42   HTTP_RESPONSE_START = ['HTTP', '/1.1 ']
43   HTTP_EXPECT = "HTTP_EXPECT"
45   # :startdoc:
46 end