diff options
Diffstat (limited to 'lib/unicorn/const.rb')
-rw-r--r-- | lib/unicorn/const.rb | 69 |
1 files changed, 36 insertions, 33 deletions
diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb index b428be5..c65c242 100644 --- a/lib/unicorn/const.rb +++ b/lib/unicorn/const.rb @@ -1,36 +1,39 @@ # -*- encoding: binary -*- -module Unicorn - - # 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. - module Const - - # The current version of Unicorn, currently 1.1.7 - UNICORN_VERSION="1.1.7" - - DEFAULT_HOST = "0.0.0.0" # default TCP listen host address - DEFAULT_PORT = 8080 # default TCP listen port - DEFAULT_LISTEN = "#{DEFAULT_HOST}:#{DEFAULT_PORT}" - - # The basic max request size we'll try to read. - CHUNK_SIZE=(16 * 1024) - - # Maximum request body size before it is moved out of memory and into a - # temporary file for reading (112 kilobytes). - MAX_BODY=1024 * 112 - - # common errors we'll send back - ERROR_400_RESPONSE = "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" - - # A frozen format for this is about 15% faster - REMOTE_ADDR="REMOTE_ADDR".freeze - RACK_INPUT="rack.input".freeze - HTTP_EXPECT="HTTP_EXPECT" - end - +# :enddoc: +# 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. +module Unicorn::Const + + # The current version of Unicorn, currently 3.4.0 + UNICORN_VERSION = "3.4.0" + + # default TCP listen host address (0.0.0.0, all interfaces) + DEFAULT_HOST = "0.0.0.0" + + # default TCP listen port (8080) + DEFAULT_PORT = 8080 + + # default TCP listen address and port (0.0.0.0:8080) + DEFAULT_LISTEN = "#{DEFAULT_HOST}:#{DEFAULT_PORT}" + + # The basic request body size we'll try to read at once (16 kilobytes). + CHUNK_SIZE = 16 * 1024 + + # Maximum request body size before it is moved out of memory and into a + # temporary file for reading (112 kilobytes). This is the default + # value of of client_body_buffer_size. + MAX_BODY = 1024 * 112 + + # :stopdoc: + # common errors we'll send back + ERROR_400_RESPONSE = "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" + # :startdoc: end |