diff options
Diffstat (limited to 'lib/unicorn')
-rw-r--r-- | lib/unicorn/app/exec_cgi.rb | 2 | ||||
-rw-r--r-- | lib/unicorn/app/old_rails/static.rb | 2 | ||||
-rw-r--r-- | lib/unicorn/cgi_wrapper.rb | 2 | ||||
-rw-r--r-- | lib/unicorn/const.rb | 12 | ||||
-rw-r--r-- | lib/unicorn/http_request.rb | 8 | ||||
-rw-r--r-- | lib/unicorn/http_response.rb | 2 |
6 files changed, 14 insertions, 14 deletions
diff --git a/lib/unicorn/app/exec_cgi.rb b/lib/unicorn/app/exec_cgi.rb index ff52d0c..4f9216b 100644 --- a/lib/unicorn/app/exec_cgi.rb +++ b/lib/unicorn/app/exec_cgi.rb @@ -26,7 +26,7 @@ module Unicorn::App SERVER_PORT SERVER_PROTOCOL SERVER_SOFTWARE - ).map { |x| x.freeze }.freeze # frozen strings are faster for Hash lookups + ).map { |x| x.freeze } # frozen strings are faster for Hash assignments # Intializes the app, example of usage in a config.ru # map "/cgit" do diff --git a/lib/unicorn/app/old_rails/static.rb b/lib/unicorn/app/old_rails/static.rb index a1f3b6b..1a78a23 100644 --- a/lib/unicorn/app/old_rails/static.rb +++ b/lib/unicorn/app/old_rails/static.rb @@ -20,7 +20,7 @@ # with Unicorn and you should see a decent speed boost (but not as # fast as if you use a static server like nginx). class Unicorn::App::OldRails::Static < Struct.new(:app, :root, :file_server) - FILE_METHODS = { 'GET' => true, 'HEAD' => true }.freeze + FILE_METHODS = { 'GET' => true, 'HEAD' => true } REQUEST_METHOD = 'REQUEST_METHOD'.freeze REQUEST_URI = 'REQUEST_URI'.freeze PATH_INFO = 'PATH_INFO'.freeze diff --git a/lib/unicorn/cgi_wrapper.rb b/lib/unicorn/cgi_wrapper.rb index 07ed979..64848b4 100644 --- a/lib/unicorn/cgi_wrapper.rb +++ b/lib/unicorn/cgi_wrapper.rb @@ -46,7 +46,7 @@ class Unicorn::CGIWrapper < ::CGI 'language' => 'Content-Language'.freeze, 'expires' => 'Expires'.freeze, 'length' => CONTENT_LENGTH, - }.freeze + } # Takes an a Rackable environment, plus any additional CGI.new # arguments These are used internally to create a wrapper around the diff --git a/lib/unicorn/const.rb b/lib/unicorn/const.rb index bda6e46..b7a3690 100644 --- a/lib/unicorn/const.rb +++ b/lib/unicorn/const.rb @@ -7,11 +7,11 @@ module Unicorn # 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 - UNICORN_VERSION="0.91.0".freeze + UNICORN_VERSION="0.91.0" - DEFAULT_HOST = "0.0.0.0".freeze # default TCP listen host address - DEFAULT_PORT = "8080".freeze # default TCP listen port - DEFAULT_LISTEN = "#{DEFAULT_HOST}:#{DEFAULT_PORT}".freeze + 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) @@ -24,8 +24,8 @@ module Unicorn MAX_BODY=MAX_HEADER # common errors we'll send back - ERROR_400_RESPONSE = "HTTP/1.1 400 Bad Request\r\n\r\n".freeze - ERROR_500_RESPONSE = "HTTP/1.1 500 Internal Server Error\r\n\r\n".freeze + 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 diff --git a/lib/unicorn/http_request.rb b/lib/unicorn/http_request.rb index 400a63e..2d191d7 100644 --- a/lib/unicorn/http_request.rb +++ b/lib/unicorn/http_request.rb @@ -12,15 +12,15 @@ module Unicorn "rack.multiprocess" => true, "rack.multithread" => false, "rack.run_once" => false, - "rack.version" => [1, 0].freeze, - "SCRIPT_NAME" => "".freeze, + "rack.version" => [1, 0], + "SCRIPT_NAME" => "", # this is not in the Rack spec, but some apps may rely on it - "SERVER_SOFTWARE" => "Unicorn #{Const::UNICORN_VERSION}".freeze + "SERVER_SOFTWARE" => "Unicorn #{Const::UNICORN_VERSION}" } NULL_IO = StringIO.new(Z) - LOCALHOST = '127.0.0.1'.freeze + LOCALHOST = '127.0.0.1' # Being explicitly single-threaded, we have certain advantages in # not having to worry about variables being clobbered :) diff --git a/lib/unicorn/http_response.rb b/lib/unicorn/http_response.rb index 0d05b2c..f226ef3 100644 --- a/lib/unicorn/http_response.rb +++ b/lib/unicorn/http_response.rb @@ -32,7 +32,7 @@ module Unicorn # Rack does not set/require a Date: header. We always override the # Connection: and Date: headers no matter what (if anything) our # Rack application sent us. - SKIP = { 'connection' => true, 'date' => true, 'status' => true }.freeze + SKIP = { 'connection' => true, 'date' => true, 'status' => true } OUT = [] # :nodoc def self.write_header(socket, status, headers) |