1 # -*- encoding: binary -*-
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.
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)
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.
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"
44 require 'unicorn/version'